You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.5 KiB
59 lines
1.5 KiB
<template> |
|
<div class="wrapper"> |
|
<v-head></v-head> |
|
<v-sidebar></v-sidebar> |
|
<div class="content-box"> |
|
<div class="content"> |
|
<transition name="move" mode="out-in"> |
|
<!-- <keep-alive> --> |
|
<router-view></router-view> |
|
<!-- </keep-alive> --> |
|
</transition> |
|
<el-backtop target=".content"></el-backtop> |
|
</div> |
|
</div> |
|
</div> |
|
</template> |
|
|
|
<script> |
|
import vHead from '../components/Header.vue'; |
|
import vSidebar from '../components/Sidebar.vue'; |
|
import Setting from "@/setting"; |
|
import util from "@/libs/util"; |
|
export default { |
|
data () { |
|
return { |
|
tagsList: [], |
|
}; |
|
}, |
|
components: { |
|
vHead, |
|
vSidebar, |
|
}, |
|
created () { |
|
// this.autoLogout() |
|
}, |
|
methods: { |
|
// 长时间未操作,自动退出登录 |
|
autoLogout () { |
|
let lastTime = new Date().getTime(); |
|
document.onmousedown = () => { |
|
lastTime = new Date().getTime(); |
|
}; |
|
|
|
const timer = setInterval(() => { |
|
if (sessionStorage.getItem('token') && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) { |
|
clearInterval(timer) |
|
util.errorMsg("由于您已经有三个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。"); |
|
setTimeout(() => { |
|
localStorage.removeItem('ms_username'); |
|
localStorage.removeItem('token'); |
|
sessionStorage.clear() |
|
location.reload() |
|
}, 1500); |
|
} |
|
}, 1000); |
|
} |
|
} |
|
}; |
|
</script>
|
|
|