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 = ''