From fb028816845ee3fc39d5a34d93a4acf9c1c7b02d Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 8 Nov 2025 21:25:41 +0800 Subject: [PATCH] fix(forms): populate base URL for all non-official provider categories The base URL field was not populating when editing providers with categories like cn_official or aggregator. The issue was caused by inconsistent conditional logic: the input field was shown for all non-official categories, but the value extraction only worked for third_party and custom categories. Changed the category check from allowlist (third_party, custom) to denylist (official) to match the UI display logic. Now ANTHROPIC_BASE_URL correctly populates for all provider categories except official. --- src/components/providers/forms/hooks/useBaseUrlState.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/providers/forms/hooks/useBaseUrlState.ts b/src/components/providers/forms/hooks/useBaseUrlState.ts index 4cac668..f185e5d 100644 --- a/src/components/providers/forms/hooks/useBaseUrlState.ts +++ b/src/components/providers/forms/hooks/useBaseUrlState.ts @@ -33,7 +33,8 @@ export function useBaseUrlState({ // 从配置同步到 state(Claude) useEffect(() => { if (appType !== "claude") return; - if (category !== "third_party" && category !== "custom") return; + // 只有 official 类别不显示 Base URL 输入框,其他类别都需要回填 + if (category === "official") return; if (isUpdatingRef.current) return; try { @@ -50,7 +51,8 @@ export function useBaseUrlState({ // 从配置同步到 state(Codex) useEffect(() => { if (appType !== "codex") return; - if (category !== "third_party" && category !== "custom") return; + // 只有 official 类别不显示 Base URL 输入框,其他类别都需要回填 + if (category === "official") return; if (isUpdatingRef.current) return; if (!codexConfig) return;