fix(conflicts): 解决合并冲突

This commit is contained in:
sophie committed 2026-09-29 14:29:40 +08:00
commit a1828f75e6
95 files changed
+4636 -476

No files matched your search

@@ -2,8 +2,9 @@
/**
* features/user/views/UserProfilePage.vue
* 用途:工作台个人中心,展示与编辑当前用户资料、语言/主题偏好,并提供修改密码入口。
* 依赖:workspace.context(WORKSPACE_KEY)、lucide 图标、vue-i18n。
* 逻辑:路由 /workspace/profile 懒加载本页;资料状态由 useWorkspaceProfile 经工作台注入,避免与工作台分叉。
* 依赖:workspace.context(WORKSPACE_KEY)、lucide 图标、vue-i18n、isPlatformAdminUser。
* 逻辑:路由 /workspace/profile 懒加载本页;资料状态由 useWorkspaceProfile 经工作台注入。
* 角色展示优先用权限组名称;旧会话缺 role_name 时再按 is_platform_admin 回退。
*/
import { computed, inject } from 'vue';
import { useI18n } from 'vue-i18n';
@@ -12,6 +13,7 @@ import {
} from 'lucide-vue-next';
import { getUserAvatarLabel } from '@/shared/utils/user-avatar';
import { WORKSPACE_KEY } from '@/features/workspace/composables/workspace.context';
import { isPlatformAdminUser } from '@/shared/utils/auth';
const { t } = useI18n();
const userProfile = inject(WORKSPACE_KEY)!;
@@ -29,10 +31,13 @@ const displayName = computed(() => {
});
/**
* 角色展示文案。
* 个人中心角色标签。
* 核心逻辑:有权限组名称就展示名称;否则按 is_platform_admin 回退内置文案。
*/
const roleLabel = computed(() => {
return userProfile.profileUser.role === 'admin' ? t('profile.roleAdmin') : t('profile.roleUser');
const profileRoleLabel = computed(() => {
const user = userProfile.profileUser || {};
if (user.role_name) return user.role_name;
return isPlatformAdminUser(user) ? t('profile.roleAdmin') : t('profile.roleUser');
});
/**
@@ -41,7 +46,7 @@ const roleLabel = computed(() => {
const identityMeta = computed(() => {
const username = userProfile.profileUser.username;
const showUsername = Boolean(username && username !== displayName.value);
return [showUsername ? username : '', userProfile.profileUser.department, roleLabel.value]
return [showUsername ? username : '', userProfile.profileUser.department, profileRoleLabel.value]
.filter(Boolean)
.join(' · ');
});