Kaynağa Gözat

添加超时错误信息的时间显示

userName 2 ay önce
ebeveyn
işleme
efa96fc9f6
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      lightstar-web/src/app/ai-chat/page.tsx

+ 5 - 1
lightstar-web/src/app/ai-chat/page.tsx

@@ -110,7 +110,11 @@ export default function AIChatPage() {
     
     // 添加超时控制
     const timeoutPromise = new Promise((_, reject) => {
-      setTimeout(() => reject(new Error("请求超时,请检查网络连接")), 30000); // 增加到30秒
+      const now = new Date();
+      const timeString = now.toLocaleTimeString(); // 获取当前时间
+      setTimeout(() => 
+        reject(new Error(`请求超时,请检查网络连接 [${timeString}]`)), 
+        30000); // 30秒超时
     });
     
     try {