kucservice 1.5.0 → 1.5.2

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.
@@ -2233,12 +2233,25 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2233
2233
  this.self.socketTimer = setTimeout(function () {
2234
2234
  var _socket = new Socket(optionsClone, _this2._dep, _this2._reconnectCount, _this2.self);
2235
2235
 
2236
+ _this2.clearHeartCheck();
2237
+
2238
+ _this2.onopen = null;
2239
+ _this2.onclose = null;
2240
+ _this2.onerror = null;
2241
+ _this2.onmessage = null;
2242
+
2236
2243
  _this2._dep.notify('reconnect', _socket);
2237
2244
  }, TIMEOUT);
2238
2245
  } // } else {
2239
2246
  // return console.error('WebSocket重连失败, 请联系技术客服!')
2240
2247
  // }
2241
2248
 
2249
+ } else {
2250
+ this.clearHeartCheck();
2251
+ this.onopen = null;
2252
+ this.onclose = null;
2253
+ this.onerror = null;
2254
+ this.onmessage = null;
2242
2255
  }
2243
2256
  };
2244
2257
 
@@ -2301,8 +2314,12 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2301
2314
  key: "closeSocket",
2302
2315
  value: function closeSocket(code, reason) {
2303
2316
  this.clearHeartCheck();
2304
- console.log('=====close code===', code, reason);
2305
- this.close(code, reason);
2317
+ console.log('=====close code===', code, reason); // this.onopen = null
2318
+ // this.onclose = null
2319
+ // this.onerror = null
2320
+ // this.onmessage = null
2321
+
2322
+ this.close(code || 1000, reason);
2306
2323
  } // 开始心跳检测
2307
2324
 
2308
2325
  }, {
@@ -11548,6 +11565,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
11548
11565
  _onError && _onError(e);
11549
11566
  },
11550
11567
  onReconnect: function onReconnect(e) {
11568
+ _this.socket = null;
11551
11569
  _this.socket = e;
11552
11570
 
11553
11571
  _this.initSocket({
@@ -11604,8 +11622,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
11604
11622
  _classPrivateFieldSet(this, _player, null);
11605
11623
 
11606
11624
  this.socketTimer && clearTimeout(this.socketTimer);
11607
- (_this$socket2 = this.socket) === null || _this$socket2 === void 0 ? void 0 : _this$socket2.closeSocket(1000, '通知关闭websocket连接');
11608
- this.socket = null;
11625
+ (_this$socket2 = this.socket) === null || _this$socket2 === void 0 ? void 0 : _this$socket2.closeSocket(1000, '通知关闭websocket连接'); // this.socket = null
11609
11626
 
11610
11627
  if (_classPrivateFieldGet(this, _phoneClientObj)) {
11611
11628
  _classPrivateFieldGet(this, _phoneClientObj).onclose();
Binary file