Files
zhuzhouzhongwu/acs/acs2/nladmin-ui/src/App.vue
zhengxuming dc87e7dd26 Add 'acs/' from commit 'e256468765ea555bed4c02ba2b9b2c6fa3a3c767'
git-subtree-dir: acs
git-subtree-mainline: 9ddaabe33f
git-subtree-split: e256468765
2025-07-17 13:21:33 +08:00

38 lines
736 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>