修复 基础设置下拉框初始值缺失问题

This commit is contained in:
2026-04-17 19:43:59 +08:00
parent 497289c59e
commit 3575366d53

View File

@@ -787,6 +787,10 @@ const loadSettings = async () => {
const data = JSON.parse(JSON.stringify(result.data)) const data = JSON.parse(JSON.stringify(result.data))
if (!data.checkpointing) data.checkpointing = { enabled: true } if (!data.checkpointing) data.checkpointing = { enabled: true }
if (!data.mcpServers) data.mcpServers = {} if (!data.mcpServers) data.mcpServers = {}
// 确保常规设置字段有默认值
if (data.language === undefined) data.language = 'zh-CN'
if (data.theme === undefined) data.theme = 'Xcode'
if (data.bootAnimationShown === undefined) data.bootAnimationShown = true
// 确保 API 相关字段有默认值 // 确保 API 相关字段有默认值
if (data.selectedAuthType === undefined) data.selectedAuthType = 'iflow' if (data.selectedAuthType === undefined) data.selectedAuthType = 'iflow'
if (data.apiKey === undefined) data.apiKey = '' if (data.apiKey === undefined) data.apiKey = ''