Files
WuXiDiKe/acs/nladmin-ui/src/App.vue
周俊杰 284e9bb629 Add 'acs/' from commit '83816781f8c26a15e081a5746c83a3c9ea56fb90'
git-subtree-dir: acs
git-subtree-mainline: b86787e9d6
git-subtree-split: 83816781f8
2024-06-05 17:14:41 +08:00

37 lines
735 B
Vue

<template>
<div id="app" @mousemove="moveEvent" @click="moveEvent">
<router-view />
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
timmer: null
}
},
methods: {
moveEvent: function() {
const path = ['/login']
if (!path.includes(this.$route.path)) {
clearTimeout(this.timmer)
this.init()
}
},
init: function() {
this.timmer = setTimeout(() => {
sessionStorage.clear()
this.logout()
}, 1000 * 60 * 151) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
},
logout() {
this.$store.dispatch('LogOut').then(() => {
location.reload()
})
}
}
}
</script>