feat: 路由守卫调整/
This commit is contained in:
@ -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;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user