fix:修复用户登录和切换访客登录的问题

This commit is contained in:
Xwen
2023-12-16 10:03:29 +08:00
parent a03a7162dd
commit 3a2d8846bc
5 changed files with 27 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { login, logout, getInfo, register } from "@/apis/accountApi";
import { login, logout, register } from "@/apis/accountApi";
import { getUserDetailInfo } from "@/apis/auth";
import useAuths from "@/hooks/useAuths";
import { defineStore } from "pinia";
@@ -106,6 +106,15 @@ const useUserStore = defineStore("user", {
});
});
},
// 重置用户信息
resetInfo() {
this.roles = [];
this.permissions = [];
this.name = "未登录";
this.icon = "/src/assets/common/icons/login.svg";
this.userName = "";
this.id = "";
},
},
});
export default useUserStore;