@zgfe/business-lib 1.1.33-visual.0 → 1.1.33-visual.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.
@@ -12,8 +12,8 @@ declare class SocketClient {
12
12
  constructor(url: string, appkey: string, params?: Record<string, any>);
13
13
  emit(event: string, payload?: SocketClientTypes.Message['data']['payload']): void;
14
14
  on<T>(type: SocketClientTypes.EventType | string, handle: (data?: T) => void): void;
15
- onConnected(handle: () => void): void;
16
- onDisconnected(handle: () => void): void;
15
+ onConnected(handle: (data?: any) => void): void;
16
+ onDisconnected(handle: (data?: any) => void): void;
17
17
  onError(handle: (data?: Error) => void): void;
18
18
  private _onError;
19
19
  private _onClose;
@@ -138,7 +138,7 @@ var SocketClient = /*#__PURE__*/function () {
138
138
  }, {
139
139
  key: "onMessage",
140
140
  value: function onMessage(event) {
141
- var _this$listeners$Socke, _this$listeners$Socke2, _this$listeners$Socke3;
141
+ var _this$listeners$Socke, _this$listeners$Socke2, _this$listeners$Socke3, _this$listeners$unkno;
142
142
  var res = JSON.parse(event.data);
143
143
  if (res.code) {
144
144
  switch (Number(res.code)) {
@@ -159,6 +159,10 @@ var SocketClient = /*#__PURE__*/function () {
159
159
  break;
160
160
  case SocketClientTypes.ResponseCode.paramError:
161
161
  this._onError(new Error('参数缺失或错误'));
162
+ default:
163
+ (_this$listeners$unkno = this.listeners['unknownCode']) === null || _this$listeners$unkno === void 0 ? void 0 : _this$listeners$unkno.forEach(function (handle) {
164
+ handle.call(undefined, res);
165
+ });
162
166
  }
163
167
  } else if (res.type === SocketClientTypes.RequestType.pong) {
164
168
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.33-visual.0",
3
+ "version": "1.1.33-visual.3",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -59,5 +59,5 @@
59
59
  "react": "^16.12.0 || ^17.0.0",
60
60
  "yorkie": "^2.0.0"
61
61
  },
62
- "gitHead": "002fa6a9d6743b99fc8e3612269d7d028d4ae9f1"
62
+ "gitHead": "a7a5d1bf1118aca61cb3a1e59e2a5d6ea160357f"
63
63
  }