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.
@@ -2120,13 +2120,17 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2120
2120
  }
2121
2121
 
2122
2122
  ((_this$self = this.self) === null || _this$self === void 0 ? void 0 : _this$self.socketTimer) && clearTimeout(this.self.socketTimer);
2123
- this.self.socketTimer = setTimeout(function () {
2124
- var _socket = new Socket(optionsClone, _this2._dep, _this2._reconnectCount, _this2.self);
2125
2123
 
2126
- _this2._dep.notify('reconnect', _socket);
2127
- }, TIMEOUT); // } else {
2124
+ if (this.self) {
2125
+ this.self.socketTimer = setTimeout(function () {
2126
+ var _socket = new Socket(optionsClone, _this2._dep, _this2._reconnectCount, _this2.self);
2127
+
2128
+ _this2._dep.notify('reconnect', _socket);
2129
+ }, TIMEOUT);
2130
+ } // } else {
2128
2131
  // return console.error('WebSocket重连失败, 请联系技术客服!')
2129
2132
  // }
2133
+
2130
2134
  }
2131
2135
  };
2132
2136
 
@@ -2189,6 +2193,7 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2189
2193
  key: "closeSocket",
2190
2194
  value: function closeSocket(code, reason) {
2191
2195
  this.clearHeartCheck();
2196
+ console.log('=====close code===', code, reason);
2192
2197
  this.close(code, reason);
2193
2198
  } // 开始心跳检测
2194
2199
 
@@ -10268,7 +10273,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
10268
10273
 
10269
10274
  _classPrivateFieldSet(this, _player, null);
10270
10275
 
10271
- this.socket.closeSocket();
10276
+ this.socket.closeSocket(1000, '通知关闭websocket连接');
10272
10277
  if (_classPrivateFieldGet(this, _phoneClientObj)) _classPrivateFieldGet(this, _phoneClientObj).onclose();
10273
10278
  }
10274
10279
  }]);
Binary file