kucservice 1.1.2 → 1.1.4

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.
@@ -4136,9 +4136,8 @@ var Socket = /*#__PURE__*/function (_WebSocket) {
4136
4136
  } else {
4137
4137
  // 处理普通数据
4138
4138
  try {
4139
- var _parseData = JSON.parse(e.data);
4140
-
4141
- this._dep.notify('message', _parseData);
4139
+ // const _parseData = JSON.parse(e.data)
4140
+ this._dep.notify('message', e.data);
4142
4141
  } catch (error) {
4143
4142
  console.log(error);
4144
4143
  }
@@ -4224,7 +4223,6 @@ var useSocket = function useSocket() {
4224
4223
 
4225
4224
  var _self = arguments.length > 1 ? arguments[1] : undefined;
4226
4225
 
4227
- debugger;
4228
4226
  if (!window.WebSocket) return console.error('您的浏览器不支持WebSocket, 请更换浏览器!');
4229
4227
  var dep = new EventMap();
4230
4228
  var reconnectCount = 0;
@@ -16195,6 +16193,8 @@ var _player = /*#__PURE__*/new WeakMap();
16195
16193
 
16196
16194
  var common_request_wsClass = /*#__PURE__*/function () {
16197
16195
  function wsClass(config, _ref2) {
16196
+ var _this = this;
16197
+
16198
16198
  var _onOpen = _ref2.onOpen,
16199
16199
  _onClose = _ref2.onClose,
16200
16200
  _onMessage = _ref2.onMessage,
@@ -16216,8 +16216,10 @@ var common_request_wsClass = /*#__PURE__*/function () {
16216
16216
  onOpen: function onOpen(e) {
16217
16217
  // 登录
16218
16218
  console.log('====onOpen=====');
16219
- console.log(this);
16220
- this.send('Login');
16219
+ console.log(_this);
16220
+
16221
+ _this.send('Login');
16222
+
16221
16223
  _onOpen && _onOpen(e);
16222
16224
  },
16223
16225
  onClose: function onClose(e) {
@@ -16226,7 +16228,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
16226
16228
  onMessage: function onMessage(e) {
16227
16229
  if (e.data === 'Back_Login') {
16228
16230
  // 设置坐席
16229
- this.config.AgentGroupName && this.send("SetGroupRole", this.config.AgentGroupName);
16231
+ _this.config.AgentGroupName && _this.send("SetGroupRole", _this.config.AgentGroupName);
16230
16232
  return;
16231
16233
  }
16232
16234
 
@@ -16236,7 +16238,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
16236
16238
  _onError && _onError(e);
16237
16239
  },
16238
16240
  onReconnect: function onReconnect(e) {
16239
- this.scoket = e;
16241
+ _this.scoket = e;
16240
16242
  }
16241
16243
  });
16242
16244
  }
Binary file