Files
longdianningxing/acs/nladmin-ui/src/App.vue

37 lines
734 B
Vue
Raw Normal View History

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