diff --git a/src/layout/components/UserInfo/src/UserInfo.vue b/src/layout/components/UserInfo/src/UserInfo.vue
index 355aabc..c3542d9 100644
--- a/src/layout/components/UserInfo/src/UserInfo.vue
+++ b/src/layout/components/UserInfo/src/UserInfo.vue
@@ -25,7 +25,7 @@ const prefixCls = getPrefixCls('user-info')
const avatar = computed(() => userStore.user.avatar || avatarImg)
const userName = computed(() => userStore.user.nickname ?? 'Admin')
-
+const realName=computed(()=>userStore.user.realName ?? '管理员')
// 锁定屏幕
const lockStore = useLockStore()
const getIsLock = computed(() => lockStore.getLockInfo?.isLock ?? false)
@@ -59,7 +59,7 @@ const toDocument = () => {
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index b386180..9fdcb78 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -10,7 +10,8 @@ interface UserVO {
id: number
avatar: string
nickname: string
- deptId: number
+ deptId: number,
+ realName:string
}
interface UserInfoVO {
@@ -30,7 +31,8 @@ export const useUserStore = defineStore('admin-user', {
id: 0,
avatar: '',
nickname: '',
- deptId: 0
+ deptId: 0,
+ realName: '',
}
}),
getters: {
@@ -56,6 +58,7 @@ export const useUserStore = defineStore('admin-user', {
let userInfo = wsCache.get(CACHE_KEY.USER)
if (!userInfo) {
userInfo = await getInfo()
+ console.log(userInfo)
}
this.permissions = userInfo.permissions
this.roles = userInfo.roles
@@ -92,7 +95,8 @@ export const useUserStore = defineStore('admin-user', {
id: 0,
avatar: '',
nickname: '',
- deptId: 0
+ deptId: 0,
+ realName:''
}
}
}