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