From 9debeb12b5e6c5612e79fed65cf5acf56dd84d84 Mon Sep 17 00:00:00 2001 From: user9994793890 <3722323274763196-user9994793890@noreply.coze.cn> Date: Fri, 10 Jul 2026 10:37:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:历史记录一直显示"加载中..." 原因: - switchTab 函数中使用了 event.target - 在某些情况下 event 对象未定义 - 导致JavaScript错误,整个脚本停止执行 修复: - 添加 event 参数到 switchTab 函数 - 检查 event 和 event.target 是否存在 - 避免JavaScript错误中断执行 现在历史记录应该能正常加载了。 Coze-Commit-Type: user Coze-User-ID: 3722323274763196 Coze-Conversation-ID: 9894087 --- templates/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index 8e7c87a..e177474 100644 --- a/templates/index.html +++ b/templates/index.html @@ -493,11 +493,13 @@ const pageSize = 20; // 切换标签页 - function switchTab(tabName) { + function switchTab(tabName, event) { document.querySelectorAll('.tab').forEach(t => t.classList.remove('active')); document.querySelectorAll('.tab-content').forEach(t => t.classList.remove('active')); - event.target.classList.add('active'); + if (event && event.target) { + event.target.classList.add('active'); + } document.getElementById(`${tabName}-tab`).classList.add('active'); if (tabName === 'config') {