更改
This commit is contained in:
parent
ef56fd2457
commit
e378b3b63b
@ -241,7 +241,12 @@ export default {
|
||||
// 页面加载完毕调用
|
||||
this.tabLsit();
|
||||
this.getWebBaseInfo();
|
||||
|
||||
// 监听窗口关闭事件
|
||||
window.addEventListener('beforeunload', this.handleBeforeUnload);
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 组件销毁前移除事件监听
|
||||
window.removeEventListener('beforeunload', this.handleBeforeUnload);
|
||||
},
|
||||
|
||||
methods:{
|
||||
@ -347,6 +352,11 @@ export default {
|
||||
location.href = '/index';
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 定义处理窗口关闭前的事件
|
||||
handleBeforeUnload() {
|
||||
// 清空localStorage中的isLoggedIn
|
||||
localStorage.removeItem('isLoggedIn');
|
||||
},
|
||||
tabClick(url,id,index){
|
||||
this.tabindex = index
|
||||
|
Loading…
Reference in New Issue
Block a user