init project
This commit is contained in:
36
lms/nladmin-ui/src/App.vue
Normal file
36
lms/nladmin-ui/src/App.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user