From ad9a784e8cbc649dc48469c7fa5afd45e9c1ee48 Mon Sep 17 00:00:00 2001 From: liangxu Date: Mon, 20 Apr 2026 15:44:51 +0800 Subject: [PATCH] fix(accounts): hide AI-platform accounts from publish-only views After splitting AI platforms into their own catalog, the admin MediaView and desktop AccountsView still showed yuanbao/kimi/wenxin/deepseek/doubao/qwen rows alongside publish platforms. Filter by publish catalog membership so those views stay scoped to publish accounts only. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/admin-web/src/lib/publish-platforms.ts | 5 +++++ apps/admin-web/src/views/MediaView.vue | 3 ++- apps/desktop-client/src/renderer/views/AccountsView.vue | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/admin-web/src/lib/publish-platforms.ts b/apps/admin-web/src/lib/publish-platforms.ts index 35d0f65..aed0179 100644 --- a/apps/admin-web/src/lib/publish-platforms.ts +++ b/apps/admin-web/src/lib/publish-platforms.ts @@ -25,6 +25,11 @@ const platformCatalog: Record { const normalized = normalizePublishPlatformId(platformId); const fallbackShortName = normalized.slice(0, 1).toUpperCase() || "?"; diff --git a/apps/admin-web/src/views/MediaView.vue b/apps/admin-web/src/views/MediaView.vue index d4e19b8..9f19ebb 100644 --- a/apps/admin-web/src/views/MediaView.vue +++ b/apps/admin-web/src/views/MediaView.vue @@ -7,7 +7,7 @@ import { useI18n } from "vue-i18n"; import { mediaApi, resolveApiURL, tenantAccountsApi } from "@/lib/api"; import { formatDateTime } from "@/lib/display"; -import { getPublishPlatformMeta, normalizePublishPlatformId } from "@/lib/publish-platforms"; +import { getPublishPlatformMeta, isPublishPlatformId, normalizePublishPlatformId } from "@/lib/publish-platforms"; type AccountHealthFilter = "all" | "live" | "captcha" | "risk" | "expired"; type PublishState = "immediate" | "queued" | "unavailable"; @@ -79,6 +79,7 @@ const platformMap = computed(() => { const mediaAccounts = computed(() => { return [...(accountsQuery.data.value ?? [])] .filter((account) => !account.deleted_at) + .filter((account) => isPublishPlatformId(account.platform)) .map((account) => { const platformId = normalizePublishPlatformId(account.platform); const platform = platformMap.value.get(platformId); diff --git a/apps/desktop-client/src/renderer/views/AccountsView.vue b/apps/desktop-client/src/renderer/views/AccountsView.vue index ab39c79..6a3d6a8 100644 --- a/apps/desktop-client/src/renderer/views/AccountsView.vue +++ b/apps/desktop-client/src/renderer/views/AccountsView.vue @@ -22,8 +22,11 @@ const actionSuccess = ref(null); type AccountAuthState = "authorized" | "expired" | "attention" | "risk"; type AccountRow = Readonly> & { tags: readonly string[] }; +const publishPlatformIds = new Set(desktopPublishMediaCatalog.map((item) => item.id)); -const accounts = computed(() => snapshot.value?.accounts ?? []); +const accounts = computed(() => + (snapshot.value?.accounts ?? []).filter((account) => publishPlatformIds.has(account.platform)), +); const overview = computed(() => ({ authorized: accounts.value.filter((item) => item.health === "live").length,