From ec6f0c527a09ac848391b6fe43dd3e0bbd086f06 Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Fri, 6 Feb 2026 12:52:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=85=9C=E5=BA=95=E4=B8=8E=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 套餐标签仅使用后端返回的 packageName 字段,不再本地缓存、默认值回填或多字段兼容。 --- apps/web-antd/src/api/core/user.ts | 17 +---------------- apps/web-antd/src/layouts/basic.vue | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) 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() {