自动登录调整
This commit is contained in:
parent
a77d9d0781
commit
0f5c3bc2e0
@ -35,7 +35,7 @@ export default {
|
||||
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
callback: action => {
|
||||
this.$store.dispatch('LogOut').then(resp => {
|
||||
this.$store.dispatch('exit').then(resp => {
|
||||
this.$router.push({path: loginInfo[getSessionStorage('project')].loginPath});
|
||||
});
|
||||
}
|
||||
@ -53,13 +53,13 @@ export default {
|
||||
window.addEventListener('unload', async e => {
|
||||
gap_time = new Date().getTime() - beforeUnload_time;
|
||||
if (gap_time <= 5) {
|
||||
await this.$store.dispatch('LogOut');
|
||||
await this.$store.dispatch('exit');
|
||||
}
|
||||
});
|
||||
window.addEventListener('beforeunload', async e => {
|
||||
beforeUnload_time = new Date().getTime();
|
||||
if (isFireFox) {
|
||||
await this.$store.dispatch('LogOut');
|
||||
await this.$store.dispatch('exit');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -165,6 +165,20 @@ const user = {
|
||||
});
|
||||
},
|
||||
|
||||
// 关闭页面
|
||||
exit({ commit, dispatch }) {
|
||||
const token = getToken();
|
||||
return new Promise((resolve, reject) => {
|
||||
dispatch('FedLogOut').then(resp => {
|
||||
logout(token).then(() => {
|
||||
resolve();
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
SetAccount({ commit }, account) {
|
||||
commit('SET_ACCOUNT', account);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user