ConsoleOAuthFlow: 添加 base_url URL 格式验证

This commit is contained in:
HitMargin
2026-04-05 14:17:40 +08:00
parent 41f733a60f
commit a50971f26f

View File

@@ -19,6 +19,7 @@ import { Select } from './CustomSelect/select.js'
import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js' import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js'
import { Spinner } from './Spinner.js' import { Spinner } from './Spinner.js'
import TextInput from './TextInput.js' import TextInput from './TextInput.js'
import { fi } from 'zod/v4/locales'
type Props = { type Props = {
onDone(): void onDone(): void
@@ -659,11 +660,11 @@ function OAuthStatusMessage({
message: 'Failed to save settings. Please try again.', message: 'Failed to save settings. Please try again.',
toRetry: { toRetry: {
state: 'custom_platform', state: 'custom_platform',
baseUrl: '', baseUrl: finalVals.base_url ?? '',
apiKey: '', apiKey: finalVals.api_key ?? '',
haikuModel: '', haikuModel: finalVals.haiku_model ?? '',
sonnetModel: '', sonnetModel: finalVals.sonnet_model ?? '',
opusModel: '', opusModel: finalVals.opus_model ?? '',
activeField: 'base_url', activeField: 'base_url',
}, },
}) })
@@ -878,11 +879,11 @@ function OAuthStatusMessage({
message: 'Failed to save settings. Please try again.', message: 'Failed to save settings. Please try again.',
toRetry: { toRetry: {
state: 'openai_chat_api', state: 'openai_chat_api',
baseUrl: '', baseUrl: finalVals.base_url ?? '',
apiKey: '', apiKey: finalVals.api_key ?? '',
haikuModel: '', haikuModel: finalVals.haiku_model ?? '',
sonnetModel: '', sonnetModel: finalVals.sonnet_model ?? '',
opusModel: '', opusModel: finalVals.opus_model ?? '',
activeField: 'base_url', activeField: 'base_url',
}, },
}) })