fix: 功能完善修复。

This commit is contained in:
tianyongbao
2026-07-12 12:49:10 +08:00
parent aeb1e39920
commit cc1ccad308
25 changed files with 350 additions and 155 deletions

View File

@@ -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',