|
@@ -24,6 +24,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|
|
orgName:'', // 组织名称
|
|
|
roles: [], // 角色
|
|
|
isCenter: false, // 当前本部门是否是中心
|
|
|
+ monitor: false, // 是否是班长
|
|
|
},
|
|
|
}),
|
|
|
actions: {
|
|
@@ -38,17 +39,18 @@ export const useUserInfo = defineStore('userInfo', {
|
|
|
try {
|
|
|
// 个人信息
|
|
|
let userInfo: any = await getUserInfo();
|
|
|
- this.userInfos.name = userInfo.result.name ?? '暂无名称';
|
|
|
- this.userInfos.account = userInfo.result.account ?? '';
|
|
|
- this.userInfos.phoneNo = userInfo.result.phoneNo ?? '';
|
|
|
- this.userInfos.staffNo = userInfo.result.staffNo ?? '';
|
|
|
+ this.userInfos.name = userInfo.result?.user.name ?? '暂无名称';
|
|
|
+ this.userInfos.account = userInfo.result?.user.account ?? '';
|
|
|
+ this.userInfos.phoneNo = userInfo.result?.user.phoneNo ?? '';
|
|
|
+ this.userInfos.staffNo = userInfo.result?.user.staffNo ?? '';
|
|
|
this.userInfos.defaultTelNo = userInfo.result.defaultTelNo ?? '';
|
|
|
- this.userInfos.id = userInfo.result.id ?? '';
|
|
|
- this.userInfos.roles = userInfo.result.roles ?? [];
|
|
|
+ this.userInfos.id = userInfo.result?.user.id ?? '';
|
|
|
+ this.userInfos.roles = userInfo.result?.user.roles ?? [];
|
|
|
this.userInfos.token = Cookie.get('token') ?? '';
|
|
|
this.userInfos.photo = "";
|
|
|
- this.userInfos.orgName = userInfo.result.organization?.name ?? '';
|
|
|
- this.userInfos.isCenter = userInfo.result.organization?.isCenter ?? false;
|
|
|
+ this.userInfos.orgName = userInfo.result?.user.organization?.name ?? '';
|
|
|
+ this.userInfos.isCenter = userInfo.result?.user.organization?.isCenter ?? false;
|
|
|
+ this.userInfos.monitor = userInfo.result?.monitor ?? false;
|
|
|
//授权按钮
|
|
|
this.userInfos.showTelControl = buttons.includes('public:seat:panel'); // 查询是否有展示面板权限
|
|
|
this.userInfos.authBtnList = buttons;
|
|
@@ -77,6 +79,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|
|
orgName:'', // 组织名称
|
|
|
roles: [], // 角色
|
|
|
isCenter: false, // 当前部门是否是中心
|
|
|
+ monitor: false, // 是否是班长
|
|
|
}
|
|
|
Session.set('userInfo', this.userInfos);
|
|
|
return this.userInfos;
|