fix : bug

This commit is contained in:
杨航
2025-12-05 09:05:42 +08:00
parent a8f46124c7
commit bca24af5f7
5 changed files with 19 additions and 3 deletions
+2 -2
View File
@@ -86,7 +86,7 @@ export default class WebSocketUtil {
// console.log('WebSocket连接已关闭', res);
clearInterval(this.heartbeatTimer); // 清除心跳计时器
this.triggerEvent('close', res); // 触发连接关闭事件
this.tryReconnect(); // 尝试重连
// this.tryReconnect(); // 尝试重连
});
// 监听WebSocket错误事件
@@ -106,7 +106,7 @@ export default class WebSocketUtil {
*/
on(event, callback) {
if (this.callbacks[event]) {
this.callbacks[event].push(callback);
this.callbacks[event] = [callback];
}
return this;
}