kucservice 1.4.9 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2242,6 +2242,8 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2242
2242
  this.self.socketTimer = setTimeout(function () {
2243
2243
  var _socket = new Socket(optionsClone, _this2._dep, _this2._reconnectCount, _this2.self);
2244
2244
 
2245
+ _this2.closeSocket();
2246
+
2245
2247
  _this2._dep.notify('reconnect', _socket);
2246
2248
  }, TIMEOUT);
2247
2249
  } // } else {
@@ -2311,7 +2313,11 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2311
2313
  value: function closeSocket(code, reason) {
2312
2314
  this.clearHeartCheck();
2313
2315
  console.log('=====close code===', code, reason);
2314
- this.close(code, reason);
2316
+ this.onopen = null;
2317
+ this.onclose = null;
2318
+ this.onerror = null;
2319
+ this.onmessage = null;
2320
+ this.close(code || 1000, reason);
2315
2321
  } // 开始心跳检测
2316
2322
 
2317
2323
  }, {
@@ -11557,7 +11563,8 @@ var common_request_wsClass = /*#__PURE__*/function () {
11557
11563
  _onError && _onError(e);
11558
11564
  },
11559
11565
  onReconnect: function onReconnect(e) {
11560
- _this.scoket = e;
11566
+ _this.socket = null;
11567
+ _this.socket = e;
11561
11568
 
11562
11569
  _this.initSocket({
11563
11570
  onOpen: _onOpen,
Binary file