diff --git a/web/src/stores/interface/index.ts b/web/src/stores/interface/index.ts index 145375a..9f73c92 100644 --- a/web/src/stores/interface/index.ts +++ b/web/src/stores/interface/index.ts @@ -2,18 +2,19 @@ * 定义接口来定义对象的类型 * `stores` 全部类型定义在这里 */ -import {useFrontendMenuStore} from "/@/stores/frontendMenu"; +import { useFrontendMenuStore } from "/@/stores/frontendMenu"; // 用户信息 export interface UserInfosState { - id:'', + id: '', avatar: string; + is_superuser: boolean, username: string; name: string; email: string; mobile: string; gender: string; - pwd_change_count:null|number; + pwd_change_count: null | number; dept_info: { dept_id: number; dept_name: string; @@ -108,9 +109,9 @@ export interface ConfigStates { export interface FrontendMenu { arrayRouter: Array; - treeRouter:Array; + treeRouter: Array; - frameOutRoutes:Array; + frameOutRoutes: Array; - frameInRoutes:Array; + frameInRoutes: Array; } diff --git a/web/src/stores/userInfo.ts b/web/src/stores/userInfo.ts index 9250f93..c896214 100644 --- a/web/src/stores/userInfo.ts +++ b/web/src/stores/userInfo.ts @@ -20,6 +20,7 @@ export const useUserInfo = defineStore('userInfo', { mobile: '', gender: '', pwd_change_count:null, + is_superuser: false, dept_info: { dept_id: 0, dept_name: '', @@ -48,6 +49,7 @@ export const useUserInfo = defineStore('userInfo', { this.userInfos.dept_info = userInfos.dept_info; this.userInfos.role_info = userInfos.role_info; this.userInfos.pwd_change_count = userInfos.pwd_change_count; + this.userInfos.is_superuser = userInfos.is_superuser; Session.set('userInfo', this.userInfos); }, async setUserInfos() { @@ -66,6 +68,7 @@ export const useUserInfo = defineStore('userInfo', { this.userInfos.dept_info = userInfos.data.dept_info; this.userInfos.role_info = userInfos.data.role_info; this.userInfos.pwd_change_count = userInfos.data.pwd_change_count; + this.userInfos.is_superuser = userInfos.data.is_superuser; Session.set('userInfo', this.userInfos); } }, @@ -87,6 +90,7 @@ export const useUserInfo = defineStore('userInfo', { this.userInfos.dept_info = res.data.dept_info; this.userInfos.role_info = res.data.role_info; this.userInfos.pwd_change_count = res.data.pwd_change_count; + this.userInfos.is_superuser = res.data.is_superuser; Session.set('userInfo', this.userInfos); }) },