|
|
@ -129,6 +129,7 @@ export default { |
|
|
|
this.leavePage() |
|
|
|
this.leavePage() |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
|
|
|
|
this.autoLogout() |
|
|
|
this.assessmentId = this.getCookie("assessmentId"); |
|
|
|
this.assessmentId = this.getCookie("assessmentId"); |
|
|
|
if (window.history && window.history.pushState) { |
|
|
|
if (window.history && window.history.pushState) { |
|
|
|
// 向历史记录中插入了当前页 |
|
|
|
// 向历史记录中插入了当前页 |
|
|
@ -154,6 +155,20 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
autoLogout(){ |
|
|
|
|
|
|
|
let lastTime = new Date().getTime() |
|
|
|
|
|
|
|
let logout = false |
|
|
|
|
|
|
|
document.onmousedown = () => { |
|
|
|
|
|
|
|
lastTime = new Date().getTime() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
|
|
|
|
if((new Date().getTime() - lastTime) > this.$config.autoLogoutTime){ |
|
|
|
|
|
|
|
logout || this.$message.error('用户登录过期,请重新登录') |
|
|
|
|
|
|
|
logout = true |
|
|
|
|
|
|
|
setTimeout(this.back,1500) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
},1000) |
|
|
|
|
|
|
|
}, |
|
|
|
goBack() { |
|
|
|
goBack() { |
|
|
|
this.leavePage() |
|
|
|
this.leavePage() |
|
|
|
history.back() |
|
|
|
history.back() |
|
|
|