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) <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,11 @@ const platformCatalog: Record<string, Omit<PublishPlatformOption, "accountLabel"
|
||||
dongchedi: { id: "dongchedi", name: "懂车帝", shortName: "懂", accent: "#fadb14" },
|
||||
};
|
||||
|
||||
export function isPublishPlatformId(platformId?: string | null): boolean {
|
||||
const normalized = normalizePublishPlatformId(platformId);
|
||||
return Boolean(normalized) && normalized in platformCatalog;
|
||||
}
|
||||
|
||||
export function getPublishPlatformMeta(platformId: string): Omit<PublishPlatformOption, "accountLabel" | "bound"> {
|
||||
const normalized = normalizePublishPlatformId(platformId);
|
||||
const fallbackShortName = normalized.slice(0, 1).toUpperCase() || "?";
|
||||
|
||||
@@ -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<MediaAccountCard[]>(() => {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user