소스 검색

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

userName 2 달 전
부모
커밋
efa96fc9f6
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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 {