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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user