feat: 路由守卫调整/

This commit is contained in:
renxiaodong
2025-06-23 03:16:55 -04:00
parent f2ce7a8539
commit 9d7f06ad0b
8 changed files with 60 additions and 62 deletions

View File

@ -1,7 +1,3 @@
/*
* @Author: RenXiaoDong
* @Date: 2025-06-22 22:26:22
*/
import { defineStore } from 'pinia';
interface UserInfo {
@ -39,6 +35,11 @@ export const useUserStore = defineStore('user', {
companyInfo: null,
isLogin: false,
}),
getters: {
isLogin(): boolean {
return !!this.token;
},
},
actions: {
// 设置 Token
setToken(token: string) {
@ -74,14 +75,5 @@ export const useUserStore = defineStore('user', {
getCompanyInfo(): CompanyInfo | null {
return this.companyInfo;
},
// 登录状态
setIsLogin(isLogin: boolean) {
this.isLogin = isLogin;
},
getIsLogin(): boolean {
return this.isLogin;
},
},
});