fix:修复用户登录和切换访客登录的问题
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user