diff --git a/apps/web-antd/src/api/core/user.ts b/apps/web-antd/src/api/core/user.ts index 3a36ce1..199cbe3 100644 --- a/apps/web-antd/src/api/core/user.ts +++ b/apps/web-antd/src/api/core/user.ts @@ -3,7 +3,6 @@ import type { UserInfo } from '@vben/types'; import { requestClient } from '#/api/request'; const TENANT_STORAGE_KEY = 'sys-tenant-id'; -const PACKAGE_NAME_STORAGE_KEY = 'sys-package-name'; interface TenantUserProfile { account?: string; @@ -13,23 +12,10 @@ interface TenantUserProfile { packageName?: string; permissions?: string[]; roles?: string[]; - subscriptionPackageName?: string; tenantId?: number | string; - planName?: string; userId?: number | string; } -function resolvePackageName(profile: TenantUserProfile) { - const packageName = - profile.packageName ?? - profile.subscriptionPackageName ?? - profile.planName ?? - localStorage.getItem(PACKAGE_NAME_STORAGE_KEY) ?? - '标准版'; - - return packageName.trim() || '标准版'; -} - function normalizeId(value: null | number | string | undefined) { if (value === null || value === undefined) { return ''; @@ -40,7 +26,7 @@ function normalizeId(value: null | number | string | undefined) { function mapProfileToUserInfo(profile: TenantUserProfile): UserInfo { return { avatar: profile.avatar ?? '', - desc: resolvePackageName(profile), + desc: profile.packageName ?? '', homePath: '', realName: profile.displayName ?? profile.account ?? '', roles: profile.roles ?? [], @@ -55,7 +41,6 @@ function mapProfileToUserInfo(profile: TenantUserProfile): UserInfo { */ export async function getUserInfoApi() { const profile = await requestClient.get('/auth/profile'); - localStorage.setItem(PACKAGE_NAME_STORAGE_KEY, resolvePackageName(profile)); if (profile.tenantId !== null && profile.tenantId !== undefined) { localStorage.setItem(TENANT_STORAGE_KEY, String(profile.tenantId)); } diff --git a/apps/web-antd/src/layouts/basic.vue b/apps/web-antd/src/layouts/basic.vue index 9acdf1a..8d39d39 100644 --- a/apps/web-antd/src/layouts/basic.vue +++ b/apps/web-antd/src/layouts/basic.vue @@ -108,7 +108,7 @@ const avatar = computed(() => { }); const packageTagText = computed(() => { - return userStore.userInfo?.desc?.trim() || '标准版'; + return userStore.userInfo?.desc?.trim() ?? ''; }); async function handleLogout() {