fix: 功能完善修复。
This commit is contained in:
@@ -40,9 +40,9 @@ const useUserStore = defineStore("user", {
|
||||
});
|
||||
},
|
||||
// 获取用户信息
|
||||
getInfo() {
|
||||
getInfo(silentAuth = false) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo()
|
||||
getInfo(silentAuth)
|
||||
.then((res: any) => {
|
||||
const user = res.user;
|
||||
const avatar =
|
||||
@@ -86,6 +86,16 @@ const useUserStore = defineStore("user", {
|
||||
});
|
||||
});
|
||||
},
|
||||
// 清理本地登录状态,不调用后端退出接口(用于本地 token 校验失败)
|
||||
resetToken() {
|
||||
this.token = "";
|
||||
this.roles = [];
|
||||
this.permissions = [];
|
||||
this.name = "";
|
||||
this.userId = "";
|
||||
this.avatar = "";
|
||||
removeToken();
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
key: 'user-store',
|
||||
|
||||
Reference in New Issue
Block a user