update
This commit is contained in:
@ -84,6 +84,17 @@ const useUserStore = defineStore("user", {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 非正常退出系统
|
||||||
|
abnormalLogOut() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.token = "";
|
||||||
|
this.roles = [];
|
||||||
|
this.permissions = [];
|
||||||
|
this.userInfoRes = null;
|
||||||
|
removeToken();
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
persist: [{ paths: ["tenant" /*"userInfoRes"*/], storage: localStorage }],
|
persist: [{ paths: ["tenant" /*"userInfoRes"*/], storage: localStorage }],
|
||||||
});
|
});
|
||||||
|
@ -119,7 +119,7 @@ service.interceptors.response.use(
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
isRelogin.show = false;
|
isRelogin.show = false;
|
||||||
useUserStore()
|
useUserStore()
|
||||||
.logOut()
|
.abnormalLogOut()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
location.href = "/index";
|
location.href = "/index";
|
||||||
});
|
});
|
||||||
@ -144,7 +144,7 @@ service.interceptors.response.use(
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
isRelogin.show = false;
|
isRelogin.show = false;
|
||||||
useUserStore()
|
useUserStore()
|
||||||
.logOut()
|
.abnormalLogOut()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
location.href = "/index";
|
location.href = "/index";
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user