fix : bug
This commit is contained in:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user