kucservice 1.4.1 → 1.4.3

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.
@@ -2111,13 +2111,17 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2111
2111
  }
2112
2112
 
2113
2113
  ((_this$self = this.self) === null || _this$self === void 0 ? void 0 : _this$self.socketTimer) && clearTimeout(this.self.socketTimer);
2114
- this.self.socketTimer = setTimeout(function () {
2115
- var _socket = new Socket(optionsClone, _this2._dep, _this2._reconnectCount, _this2.self);
2116
2114
 
2117
- _this2._dep.notify('reconnect', _socket);
2118
- }, TIMEOUT); // } else {
2115
+ if (this.self) {
2116
+ this.self.socketTimer = setTimeout(function () {
2117
+ var _socket = new Socket(optionsClone, _this2._dep, _this2._reconnectCount, _this2.self);
2118
+
2119
+ _this2._dep.notify('reconnect', _socket);
2120
+ }, TIMEOUT);
2121
+ } // } else {
2119
2122
  // return console.error('WebSocket重连失败, 请联系技术客服!')
2120
2123
  // }
2124
+
2121
2125
  }
2122
2126
  };
2123
2127
 
@@ -2180,6 +2184,7 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2180
2184
  key: "closeSocket",
2181
2185
  value: function closeSocket(code, reason) {
2182
2186
  this.clearHeartCheck();
2187
+ console.log('=====close code===', code, reason);
2183
2188
  this.close(code, reason);
2184
2189
  } // 开始心跳检测
2185
2190
 
@@ -10259,7 +10264,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
10259
10264
 
10260
10265
  _classPrivateFieldSet(this, _player, null);
10261
10266
 
10262
- this.socket.closeSocket();
10267
+ this.socket.closeSocket(1000, '通知关闭websocket连接');
10263
10268
  if (_classPrivateFieldGet(this, _phoneClientObj)) _classPrivateFieldGet(this, _phoneClientObj).onclose();
10264
10269
  }
10265
10270
  }]);
Binary file