修复:AI问答模块

This commit is contained in:
2025-07-09 12:39:29 +08:00
parent 5deb2e96b5
commit 6b36f83861
10 changed files with 247 additions and 57 deletions

View File

@@ -97,10 +97,16 @@ export class WebSocketManager {
setTimeout(() => {
this.connect().catch(error => {
console.error('重连失败:', error);
// 继续尝试重连
this.handleReconnect();
});
}, this.reconnectInterval);
}, this.reconnectInterval * this.reconnectAttempts); // 递增重连间隔
} else {
console.error('WebSocket重连次数已达上限');
// 重置重连次数,以便后续手动重连
setTimeout(() => {
this.reconnectAttempts = 0;
}, 60000); // 1分钟后重置
}
}