@zgfe/business-lib 1.1.32 → 1.1.33-visual.0

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.
@@ -8,6 +8,7 @@ declare class SocketClient {
8
8
  private showLog;
9
9
  private pingTimer?;
10
10
  private appkey?;
11
+ private token?;
11
12
  constructor(url: string, appkey: string, params?: Record<string, any>);
12
13
  emit(event: string, payload?: SocketClientTypes.Message['data']['payload']): void;
13
14
  on<T>(type: SocketClientTypes.EventType | string, handle: (data?: T) => void): void;
@@ -29,6 +29,7 @@ var SocketClient = /*#__PURE__*/function () {
29
29
  this.showLog = false;
30
30
  this.pingTimer = void 0;
31
31
  this.appkey = void 0;
32
+ this.token = void 0;
32
33
  this.appkey = appkey;
33
34
  this.url = url;
34
35
  this.params = params;
@@ -122,7 +123,7 @@ var SocketClient = /*#__PURE__*/function () {
122
123
  _this = this;
123
124
  this.log('info', 'socket连接成功', event);
124
125
  (_this$listeners$conne = this.listeners['connected']) === null || _this$listeners$conne === void 0 ? void 0 : _this$listeners$conne.forEach(function (handle) {
125
- handle.call(undefined);
126
+ handle.call(undefined, _this.token);
126
127
  });
127
128
  this.log('info', 'clear catch', this.catch);
128
129
  this.catch.forEach(function (_ref) {
@@ -235,6 +236,7 @@ var SocketClient = /*#__PURE__*/function () {
235
236
  var _this4 = this;
236
237
  this.getToken().then(function (token) {
237
238
  _this4.params = params || _this4.params;
239
+ _this4.token = token;
238
240
  if (_this4.client) _this4.close();
239
241
  var paramUrl = ["socketToken=".concat(token)];
240
242
  if (_this4.params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.32",
3
+ "version": "1.1.33-visual.0",
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": "768a74651153c58b9b05a2661eb3fe37c2c48109"
62
+ "gitHead": "002fa6a9d6743b99fc8e3612269d7d028d4ae9f1"
63
63
  }