From 55594a89e9c86aff1a1184d4d5eb4e100f1d743b Mon Sep 17 00:00:00 2001 From: tanxing Date: Wed, 13 Aug 2025 15:19:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deepsearcher/backend/templates/index.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/deepsearcher/backend/templates/index.html b/deepsearcher/backend/templates/index.html index 45714a8..80e67ad 100644 --- a/deepsearcher/backend/templates/index.html +++ b/deepsearcher/backend/templates/index.html @@ -392,13 +392,18 @@ const contentElement = document.createElement('div'); contentElement.textContent = message.content; - const timestampElement = document.createElement('div'); - timestampElement.className = 'message-timestamp'; - const date = new Date(message.timestamp * 1000); - timestampElement.textContent = date.toLocaleTimeString(); - messageElement.appendChild(contentElement); - messageElement.appendChild(timestampElement); + + // 只有在有有效时间戳时才显示时间 + if (message.timestamp && !isNaN(message.timestamp)) { + const date = new Date(message.timestamp * 1000); + if (!isNaN(date.getTime())) { + const timestampElement = document.createElement('div'); + timestampElement.className = 'message-timestamp'; + timestampElement.textContent = date.toLocaleTimeString(); + messageElement.appendChild(timestampElement); + } + } container.appendChild(messageElement); // 确保结果容器是可见的