hejianhao
2026-04-03 7030b57e7333f082751479a11d007aebf2706f65
fix: 缩短WebSocket心跳超时时间至3秒

将心跳超时时间从5秒调整为3秒,以更快检测连接异常并减少用户等待时间。
1个文件已修改
2 ■■■■■ 已修改文件
src/utils/websocket.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/websocket.ts
@@ -17,7 +17,7 @@
  private heartbeatTimer: any = null;
  private heartbeatTimeoutTimer: any = null; // 用于检测心跳超时的定时器
  private heartbeatInterval: number = 10000; // 10秒心跳
  private heartbeatTimeout: number = 5000;   // 5秒收不到响应即视为掉线
  private heartbeatTimeout: number = 3000;   // 5秒收不到响应即视为掉线
  private listeners: Map<string, MessageCallback[]> = new Map();
  private globalEventsBound: boolean = false;