This commit is contained in:
孟帅
2024-04-22 23:08:40 +08:00
parent 82483bd7b9
commit e144b12580
445 changed files with 17457 additions and 6708 deletions

View File

@@ -18,11 +18,13 @@ import {
mobileLogin,
} from '@/api/system/user';
import { isWechatBrowser } from '@/utils/is';
import { DeptTypeEnum } from '@/enums/deptEnum';
const Storage = createStorage({ storage: localStorage });
export interface UserInfoState {
id: number;
deptName: string;
deptType: string;
roleName: string;
cityLabel: string;
permissions: string[];
@@ -55,7 +57,7 @@ export interface ConfigState {
domain: string;
version: string;
wsAddr: string;
mode:string;
mode: string;
}
export interface LoginConfigState {
@@ -114,6 +116,18 @@ export const useUserStore = defineStore({
getLoginConfig(): LoginConfigState | null {
return this.loginConfig;
},
isCompanyDept(): boolean {
return this.info?.deptType == DeptTypeEnum.Company;
},
isTenantDept(): boolean {
return this.info?.deptType == DeptTypeEnum.Tenant;
},
isMerchantDept(): boolean {
return this.info?.deptType == DeptTypeEnum.Merchant;
},
isUserDept(): boolean {
return this.info?.deptType == DeptTypeEnum.User;
},
},
actions: {
setToken(token: string) {