import Cookies from 'js-cookie'
/*区分关闭和刷新,关闭退出登录 start*/
window.onload = function(){
if(!window.sessionStorage["tempFlag"]){
Cookies.remove('token')
location.reload(); //不能省,强制跳到登陆页
}else{
window.sessionStorage.removeItem("tempFlag");
}
}
window.onunload = function (){
window.sessionStorage["tempFlag"] = true;
}
window.onbeforeunload = function (){
window.sessionStorage["tempFlag"] = true;
}
vue项目关闭页面后重新登录
最新推荐文章于 2024-07-16 10:40:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)