From 7109bdc9aa87228892a496bf6dd324c109095cd4 Mon Sep 17 00:00:00 2001 From: leokaka1 Date: Thu, 22 Jan 2026 14:21:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E9=85=8D=E7=BD=AE=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=98=BE=E7=A4=BAid=E7=9A=84bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/pages/model-compare-chat.html | 7 +++++-- web/pages/model-compare-result.html | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web/pages/model-compare-chat.html b/web/pages/model-compare-chat.html index 948a3b3..e4cccdc 100644 --- a/web/pages/model-compare-chat.html +++ b/web/pages/model-compare-chat.html @@ -373,12 +373,15 @@ } container.innerHTML = selectedModelIds.map((modelId, index) => { - const model = allAvailableModels.find(m => m.id === modelId); + // 支持 ID 数字或模型名称字符串匹配 + const model = allAvailableModels.find(m => + String(m.id) === String(modelId) || m.name === modelId + ); const colors = ['bg-blue-100 text-blue-700 border-blue-200', 'bg-green-100 text-green-700 border-green-200', 'bg-purple-100 text-purple-700 border-purple-200', 'bg-orange-100 text-orange-700 border-orange-200']; const colorClass = colors[index % colors.length]; return ` - ${model?.name || `模型 ${modelId}`} + ${model?.name || modelId} `; }).join(''); diff --git a/web/pages/model-compare-result.html b/web/pages/model-compare-result.html index 746fb9f..233f25c 100644 --- a/web/pages/model-compare-result.html +++ b/web/pages/model-compare-result.html @@ -275,7 +275,10 @@ const contentText = showLoading ? '正在调用模型API...' : '模型即将开始生成回答...'; grid.innerHTML = displayModelIds.map((modelId, index) => { - const model = allAvailableModels.find(m => m.id === modelId) || { name: `模型 ${modelId}` }; + // 支持 ID 数字或模型名称字符串匹配 + const model = allAvailableModels.find(m => + m.id == modelId || m.id === modelId || m.name === modelId + ) || { name: modelId }; const colors = ['bg-blue-100 text-blue-700', 'bg-green-100 text-green-700', 'bg-purple-100 text-purple-700', 'bg-orange-100 text-orange-700']; const colorClass = colors[index % colors.length]; return `