From a6f5876eca9a08711c62eeda26498fcd8f28e5b7 Mon Sep 17 00:00:00 2001 From: shaw Date: Sat, 11 Oct 2025 11:48:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddroid=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=B4=A6=E5=8F=B7=E7=B1=BB=E5=9E=8B=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/admin-spa/src/views/AccountsView.vue | 50 +++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/web/admin-spa/src/views/AccountsView.vue b/web/admin-spa/src/views/AccountsView.vue index 038afa34..8759dada 100644 --- a/web/admin-spa/src/views/AccountsView.vue +++ b/web/admin-spa/src/views/AccountsView.vue @@ -546,7 +546,9 @@ >Droid - OAuth + + {{ getDroidAuthType(account) }} +
{ return 'OAuth' } +// 获取 Droid 账号的认证方式 +const getDroidAuthType = (account) => { + if (!account || typeof account !== 'object') { + return 'OAuth' + } + + const apiKeyModeFlag = + account.isApiKeyMode ?? account.is_api_key_mode ?? account.apiKeyMode ?? account.api_key_mode + + if ( + apiKeyModeFlag === true || + apiKeyModeFlag === 'true' || + apiKeyModeFlag === 1 || + apiKeyModeFlag === '1' + ) { + return 'API Key' + } + + const methodCandidate = + account.authenticationMethod || + account.authMethod || + account.authentication_mode || + account.authenticationMode || + account.authentication_method || + account.auth_type || + account.authType || + account.authentication_type || + account.authenticationType || + account.droidAuthType || + account.droidAuthenticationMethod || + account.method || + account.auth || + '' + + if (typeof methodCandidate === 'string') { + const normalized = methodCandidate.trim().toLowerCase() + const compacted = normalized.replace(/[\s_-]/g, '') + + if (compacted === 'apikey') { + return 'API Key' + } + } + + return 'OAuth' +} + // 获取 Claude 账号类型显示 const getClaudeAccountType = (account) => { // 如果有订阅信息