From e56a49d7ed02e203a432f1f83088eccf93da22ee Mon Sep 17 00:00:00 2001 From: shaw Date: Sun, 24 Aug 2025 16:47:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dcodex=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=B4=A6=E5=8F=B7=E7=BC=BA=E5=B0=91oauth=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/admin-spa/src/components/accounts/AccountForm.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/admin-spa/src/components/accounts/AccountForm.vue b/web/admin-spa/src/components/accounts/AccountForm.vue index 0e0c290c..2943deca 100644 --- a/web/admin-spa/src/components/accounts/AccountForm.vue +++ b/web/admin-spa/src/components/accounts/AccountForm.vue @@ -1760,7 +1760,12 @@ const initProxyConfig = () => { // 表单数据 const form = ref({ platform: props.account?.platform || 'claude', - addType: props.account?.platform === 'gemini' ? 'oauth' : 'setup-token', + addType: (() => { + const platform = props.account?.platform || 'claude' + if (platform === 'gemini' || platform === 'openai') return 'oauth' + if (platform === 'claude') return 'setup-token' + return 'manual' + })(), name: props.account?.name || '', description: props.account?.description || '', accountType: props.account?.accountType || 'shared', @@ -2554,6 +2559,9 @@ watch( } else if (newPlatform === 'gemini') { // 切换到 Gemini 时,使用 OAuth 作为默认方式 form.value.addType = 'oauth' + } else if (newPlatform === 'openai') { + // 切换到 OpenAI 时,使用 OAuth 作为默认方式 + form.value.addType = 'oauth' } // 平台变化时,清空分组选择