feat: 创建企业逻辑对接

This commit is contained in:
rd
2025-09-10 17:57:42 +08:00
parent 25f74691c6
commit 32bc0c4b95
8 changed files with 90 additions and 50 deletions

View File

@ -1,7 +1,7 @@
import router from '@/router';
import { defineStore } from 'pinia';
import { fetchProfileInfo } from '@/api/all/login';
import { useSidebarStore } from '@/stores/modules/side-bar';
// import { useSidebarStore } from '@/stores/modules/side-bar';
import { glsWithCatch, slsWithCatch, rlsWithCatch } from '@/utils/stroage';
interface UserInfo {
@ -10,6 +10,8 @@ interface UserInfo {
head_image: String;
current_enterprise_id: number;
mobile: string;
primary_enterprise: any; // 主企业信息
[key: string]: any;
// 添加其他用户属性...
}
@ -37,6 +39,10 @@ export const useUserStore = defineStore('user', {
isLogin(): boolean {
return !!this.token;
},
// 是否开通企业
isOpenEnterprise(): boolean {
return this.userInfo?.primary_enterprise?.subscribe_status === 1;
},
},
actions: {
// 设置 Token