用户信息更新
This commit is contained in:
@@ -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<any>;
|
||||
treeRouter:Array<any>;
|
||||
treeRouter: Array<any>;
|
||||
|
||||
frameOutRoutes:Array<any>;
|
||||
frameOutRoutes: Array<any>;
|
||||
|
||||
frameInRoutes:Array<any>;
|
||||
frameInRoutes: Array<any>;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user