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.
@@ -4127,9 +4127,8 @@ var Socket = /*#__PURE__*/function (_WebSocket) {
4127
4127
  } else {
4128
4128
  // 处理普通数据
4129
4129
  try {
4130
- var _parseData = JSON.parse(e.data);
4131
-
4132
- this._dep.notify('message', _parseData);
4130
+ // const _parseData = JSON.parse(e.data)
4131
+ this._dep.notify('message', e.data);
4133
4132
  } catch (error) {
4134
4133
  console.log(error);
4135
4134
  }
@@ -4215,7 +4214,6 @@ var useSocket = function useSocket() {
4215
4214
 
4216
4215
  var _self = arguments.length > 1 ? arguments[1] : undefined;
4217
4216
 
4218
- debugger;
4219
4217
  if (!window.WebSocket) return console.error('您的浏览器不支持WebSocket, 请更换浏览器!');
4220
4218
  var dep = new EventMap();
4221
4219
  var reconnectCount = 0;
@@ -16186,6 +16184,8 @@ var _player = /*#__PURE__*/new WeakMap();
16186
16184
 
16187
16185
  var common_request_wsClass = /*#__PURE__*/function () {
16188
16186
  function wsClass(config, _ref2) {
16187
+ var _this = this;
16188
+
16189
16189
  var _onOpen = _ref2.onOpen,
16190
16190
  _onClose = _ref2.onClose,
16191
16191
  _onMessage = _ref2.onMessage,
@@ -16207,8 +16207,10 @@ var common_request_wsClass = /*#__PURE__*/function () {
16207
16207
  onOpen: function onOpen(e) {
16208
16208
  // 登录
16209
16209
  console.log('====onOpen=====');
16210
- console.log(this);
16211
- this.send('Login');
16210
+ console.log(_this);
16211
+
16212
+ _this.send('Login');
16213
+
16212
16214
  _onOpen && _onOpen(e);
16213
16215
  },
16214
16216
  onClose: function onClose(e) {
@@ -16217,7 +16219,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
16217
16219
  onMessage: function onMessage(e) {
16218
16220
  if (e.data === 'Back_Login') {
16219
16221
  // 设置坐席
16220
- this.config.AgentGroupName && this.send("SetGroupRole", this.config.AgentGroupName);
16222
+ _this.config.AgentGroupName && _this.send("SetGroupRole", _this.config.AgentGroupName);
16221
16223
  return;
16222
16224
  }
16223
16225
 
@@ -16227,7 +16229,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
16227
16229
  _onError && _onError(e);
16228
16230
  },
16229
16231
  onReconnect: function onReconnect(e) {
16230
- this.scoket = e;
16232
+ _this.scoket = e;
16231
16233
  }
16232
16234
  });
16233
16235
  }
Binary file