diff --git a/apps/web-antd/src/store/auth.ts b/apps/web-antd/src/store/auth.ts
index e4abf9c0a..a545d73c0 100644
--- a/apps/web-antd/src/store/auth.ts
+++ b/apps/web-antd/src/store/auth.ts
@@ -102,7 +102,7 @@ export const useAuthStore = defineStore('auth', () => {
let authPermissionInfo: AuthPermissionInfo | null = null;
authPermissionInfo = await getAuthPermissionInfoApi();
// userStore
- userStore.setUserInfo(authPermissionInfo.user); // TODO @芋艿:这里有报错
+ userStore.setUserInfo(authPermissionInfo.user);
userStore.setUserRoles(authPermissionInfo.roles);
// accessStore
accessStore.setAccessMenus(authPermissionInfo.menus);
diff --git a/apps/web-antd/src/views/dashboard/workspace/index.vue b/apps/web-antd/src/views/dashboard/workspace/index.vue
index b95d61381..961095b0f 100644
--- a/apps/web-antd/src/views/dashboard/workspace/index.vue
+++ b/apps/web-antd/src/views/dashboard/workspace/index.vue
@@ -239,7 +239,7 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
:avatar="userStore.userInfo?.avatar || preferences.app.defaultAvatar"
>
- 早安, {{ userStore.userInfo?.realName }}, 开始您一天的工作吧!
+ 早安, {{ userStore.userInfo?.nickname }}, 开始您一天的工作吧!
今日晴,20℃ - 32℃!
diff --git a/packages/stores/src/modules/user.ts b/packages/stores/src/modules/user.ts
index 0ae843df7..f047ef7c8 100644
--- a/packages/stores/src/modules/user.ts
+++ b/packages/stores/src/modules/user.ts
@@ -9,11 +9,7 @@ interface BasicUserInfo {
/**
* 用户昵称
*/
- realName: string;
- /**
- * 用户角色(TODO 已废弃,add by 芋艿)
- */
- roles?: string[];
+ nickname: string;
/**
* 用户id
*/
@@ -41,11 +37,7 @@ interface AccessState {
export const useUserStore = defineStore('core-user', {
actions: {
setUserInfo(userInfo: BasicUserInfo | null) {
- // 设置用户信息
this.userInfo = userInfo;
- // 设置角色信息
- const roles = userInfo?.roles ?? [];
- this.setUserRoles(roles);
},
setUserRoles(roles: string[]) {
this.userRoles = roles;
@@ -54,8 +46,7 @@ export const useUserStore = defineStore('core-user', {
state: (): AccessState => ({
userInfo: null,
userRoles: [],
- }),
- // TODO @芋艿:pick: ['userInfo', 'userRoles'], 是否要持久化
+ })
});
// 解决热更新问题