diff --git a/src/components/common/Footer.vue b/src/components/common/Footer.vue index d3217f0..4245605 100644 --- a/src/components/common/Footer.vue +++ b/src/components/common/Footer.vue @@ -1,7 +1,7 @@ diff --git a/src/components/page/AddProject.vue b/src/components/page/AddProject.vue index 002043b..83f1a7d 100644 --- a/src/components/page/AddProject.vue +++ b/src/components/page/AddProject.vue @@ -469,12 +469,10 @@ },500) }, projectPermission(val){ - if(!this.id){ - if(val){ - this.flag02 = false - }else{ - this.flag02 = true - } + if(val){ + this.flag02 = false + }else{ + this.flag02 = true } } }, diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue index 26160c8..1eacf90 100644 --- a/src/components/page/Login.vue +++ b/src/components/page/Login.vue @@ -67,8 +67,8 @@ export default { data: function() { return { param: { - username: 'admin', - password: 'admin' + username: '', + password: '' }, rules: { username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], diff --git a/src/components/page/Role.vue b/src/components/page/Role.vue index a328cee..2fe43b2 100644 --- a/src/components/page/Role.vue +++ b/src/components/page/Role.vue @@ -1,21 +1,5 @@ @@ -389,7 +389,7 @@ export default { keyword: function(val) { clearTimeout(this.searchTimer) this.searchTimer = setTimeout(() => { - this.getData() + this.initData() },500) } }, @@ -409,6 +409,10 @@ export default { }) .catch(err => {}) }, + initData(){ + this.pageNo = 1 + this.getData() + }, resetForm() { this.topicForm = { answer: '', diff --git a/src/components/page/project.vue b/src/components/page/project.vue index 9b0f3a5..b47e001 100644 --- a/src/components/page/project.vue +++ b/src/components/page/project.vue @@ -20,21 +20,21 @@
- +
- +
- +
- + @@ -220,7 +219,7 @@ export default { keyword: function(val) { clearTimeout(this.searchTimer) this.searchTimer = setTimeout(() => { - this.getData() + this.initData() },500) } }, @@ -257,6 +256,10 @@ export default { this.totals = res.pageInfo.total }).catch(res => {}); }, + initData(){ + this.pageNo = 1 + this.getData() + }, handlePage(){ let list = this.projectDataAll let result = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) diff --git a/src/components/page/student.vue b/src/components/page/student.vue index f2b0b9c..7b889e2 100644 --- a/src/components/page/student.vue +++ b/src/components/page/student.vue @@ -257,7 +257,7 @@ export default { keyword: function(val) { clearTimeout(this.searchTimer) this.searchTimer = setTimeout(() => { - this.getData() + this.initData() },500) } }, @@ -274,6 +274,10 @@ export default { this.totals = res.data.totalCount }).catch(res => {}); }, + initData(){ + this.pageNo = 1 + this.getData() + }, saveData() { this.$refs.form.validate((valid) => { if (valid) { diff --git a/src/utils/http.js b/src/utils/http.js index c309adb..03f61d3 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -101,21 +101,26 @@ axios.interceptors.request.use(config => { // } // ); +function logouts(){ + store.replaceState({}) + sessionStorage.removeItem('sta_server_username') + location.reload() +} + let logout = false export function getToken(){ - // console.log(store.state.dataTime,logout) if(process.env.NODE_ENV == 'production'){ - // if(store.state.dataTime && !logout){ - // axios.get(`${api.queryToken}?token=${store.state.token}`).then(res => { - // if(store.state.dataTime && (res.data.message != store.state.dataTime)){ - // logout || Message.error('您已在另一台设备登录,本次登录已下线!') - // logout = true - // setTimeout(() => { - // core.logout() - // },1500) - // } - // }).catch(err => {}) - // } + if(store.state.dataTime && !logout){ + axios.get(`${api.queryToken}?token=${store.state.token}`).then(res => { + if(store.state.dataTime && (res.data.message != store.state.dataTime)){ + logout || Message.error('您已在另一台设备登录,本次登录已下线!') + logout = true + setTimeout(() => { + logouts() + },1500) + } + }).catch(err => {}) + } } }