From cdddcccfe03cf9638bcfb82eedcd6dd19aca9872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E6=B6=9B?= Date: Fri, 17 Apr 2026 23:19:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20API=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=AF=B9=E8=AF=9D=E6=A1=86=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=9B=9E=E5=A1=AB=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/App.vue | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 18dcad5..1c4c6c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iflow-settings-editor", - "version": "1.5.0", + "version": "1.5.1", "description": "一个用于编辑 iFlow CLI 配置文件的桌面应用程序。", "main": "main.js", "author": "上海潘哆呐科技有限公司", diff --git a/src/App.vue b/src/App.vue index 79f7c0a..7fc8855 100644 --- a/src/App.vue +++ b/src/App.vue @@ -126,14 +126,14 @@ 使用中 -
+
-
@@ -624,12 +624,12 @@ const openApiEditDialog = profileName => { // 从 apiProfiles 中加载指定配置的数据 const profile = settings.value.apiProfiles && settings.value.apiProfiles[profileName] editingApiData.value = { - selectedAuthType: profile ? profile.selectedAuthType : settings.value.selectedAuthType || 'iflow', - apiKey: profile ? profile.apiKey : settings.value.apiKey || '', - baseUrl: profile ? profile.baseUrl : settings.value.baseUrl || '', - modelName: profile ? profile.modelName : settings.value.modelName || '', - searchApiKey: profile ? profile.searchApiKey : settings.value.searchApiKey || '', - cna: profile ? profile.cna : settings.value.cna || '', + selectedAuthType: (profile && profile.selectedAuthType) || settings.value.selectedAuthType || 'openai-compatible', + apiKey: (profile && profile.apiKey) || settings.value.apiKey || '', + baseUrl: (profile && profile.baseUrl) || settings.value.baseUrl || '', + modelName: (profile && profile.modelName) || settings.value.modelName || '', + searchApiKey: (profile && profile.searchApiKey) || settings.value.searchApiKey || '', + cna: (profile && profile.cna) || settings.value.cna || '', } showApiEditDialog.value = true } @@ -673,7 +673,7 @@ const loadSettings = async () => { if (data.theme === undefined) data.theme = 'Xcode' if (data.bootAnimationShown === undefined) data.bootAnimationShown = true // 确保 API 相关字段有默认值 - if (data.selectedAuthType === undefined) data.selectedAuthType = 'openai-compatible' + if (!data.selectedAuthType) data.selectedAuthType = 'openai-compatible' if (data.apiKey === undefined) data.apiKey = '' if (data.baseUrl === undefined) data.baseUrl = '' if (data.modelName === undefined) data.modelName = ''