From 454bdd1d811cfe5ce771f7d1a15723455a2b8203 Mon Sep 17 00:00:00 2001 From: gaoao-3 <140887777+gaoao-3@users.noreply.github.com> Date: Fri, 3 Jan 2025 18:47:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guoba.support.js | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/guoba.support.js b/guoba.support.js index 53eb9a3..e8ece4b 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -590,25 +590,35 @@ export function supportGuoba () { component: 'Divider' }, { - field: 'geminiKey', - label: 'API密钥', - bottomHelpMessage: '前往https://makersuite.google.com/app/apikey获取', - component: 'GTags', - componentProps: { - placeholder: '请输入您的 API 密钥', - allowAdd: true, - allowDel: true, - showPrompt: true, - promptProps: { - content: '请填写您的 API 密钥', - placeholder: '请输入 API 密钥', - okText: '添加' - }, - valueParser: (value) => { - if (!value) return []; - return value.split(',').filter(Boolean); - }, - }, + field: 'geminiKey', + label: 'API密钥', + bottomHelpMessage: '前往https://makersuite.google.com/app/apikey获取', + component: 'GTags', + componentProps: { + placeholder: '点击添加按钮输入 API 密钥', + allowAdd: true, + allowDel: true, + showPrompt: true, + promptProps: { + content: '添加 Gemini API Key', + placeholder: 'AIza...', + okText: '确认添加', + inputType: 'password' + }, + // 将字符串转换为数组显示 + valueParser: (value) => { + if (!value) return []; + return typeof value === 'string' ? value.split(',') : value; + }, + // 将数组转换回逗号分隔的字符串 + valueFormatter: (value) => { + if (!value) return ''; + return Array.isArray(value) ? value.join(',') : value; + }, + style: { + width: '100%' + } + } }, { field: 'geminiModel',