From 05fea676b97655d9331ce4f5ad6524b2ee87657a Mon Sep 17 00:00:00 2001 From: hex2077 Date: Thu, 5 Mar 2026 17:53:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=A4=B1=E8=B4=A5=E6=97=B6=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E5=88=B0=E6=A8=A1=E6=8B=9F=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除模拟数据生成函数,当配置加载失败时显示空列表而非错误数据,提高用户体验 --- VERSION | 2 +- static/app/upload-config-manager.js | 70 +---------------------------- static/login.html | 2 +- 3 files changed, 4 insertions(+), 70 deletions(-) diff --git a/VERSION b/VERSION index a158d08..0d90f58 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.10.6 +2.10.6.1 diff --git a/static/app/upload-config-manager.js b/static/app/upload-config-manager.js index 5769954..f843fd3 100644 --- a/static/app/upload-config-manager.js +++ b/static/app/upload-config-manager.js @@ -493,10 +493,8 @@ async function loadConfigList(searchTerm = '', statusFilter = '', providerFilter } catch (error) { console.error('加载配置列表失败:', error); showToast(t('common.error'), t('common.error') + ': ' + error.message, 'error'); - - // 使用模拟数据作为示例 - allConfigs = sortConfigs(generateMockConfigData()); - filteredConfigs = [...allConfigs]; + allConfigs = []; + filteredConfigs = []; renderConfigList(); updateStats(); } finally { @@ -505,70 +503,6 @@ async function loadConfigList(searchTerm = '', statusFilter = '', providerFilter } } -/** - * 生成模拟配置数据(用于演示) - * @returns {Array} 模拟配置数据 - */ -function generateMockConfigData() { - return [ - { - name: 'provider_pools.json', - path: './configs/provider_pools.json', - type: 'provider-pool', - size: 2048, - modified: '2025-11-11T04:30:00.000Z', - isUsed: true, - content: JSON.stringify({ - "gemini-cli-oauth": [ - { - "GEMINI_OAUTH_CREDS_FILE_PATH": "~/.gemini/oauth/creds.json", - "PROJECT_ID": "test-project" - } - ] - }, null, 2) - }, - { - name: 'config.json', - path: './configs/config.json', - type: 'other', - size: 1024, - modified: '2025-11-10T12:00:00.000Z', - isUsed: true, - content: JSON.stringify({ - "REQUIRED_API_KEY": "123456", - "SERVER_PORT": 3000 - }, null, 2) - }, - { - name: 'oauth_creds.json', - path: '~/.gemini/oauth/creds.json', - type: 'oauth', - size: 512, - modified: '2025-11-09T08:30:00.000Z', - isUsed: false, - content: '{"client_id": "test", "client_secret": "test"}' - }, - { - name: 'input_system_prompt.txt', - path: './configs/input_system_prompt.txt', - type: 'system-prompt', - size: 256, - modified: '2025-11-08T15:20:00.000Z', - isUsed: true, - content: '你是一个有用的AI助手...' - }, - { - name: 'invalid_config.json', - path: './invalid_config.json', - type: 'other', - size: 128, - modified: '2025-11-07T10:15:00.000Z', - isUsed: false, - content: '{"invalid": json}' - } - ]; -} - /** * 查看配置 * @param {string} path - 文件路径 diff --git a/static/login.html b/static/login.html index 010f70f..84ecb10 100644 --- a/static/login.html +++ b/static/login.html @@ -214,7 +214,7 @@