@zgfe/business-lib 1.1.29-visual.7 → 1.1.29-visual.8

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.
Files changed (2) hide show
  1. package/es/socket/index.js +10 -7
  2. package/package.json +2 -2
@@ -204,8 +204,14 @@ var SocketClient = /*#__PURE__*/function () {
204
204
  });
205
205
  case 2:
206
206
  res = _context.sent;
207
- return _context.abrupt("return", res);
208
- case 4:
207
+ if (res) {
208
+ _context.next = 5;
209
+ break;
210
+ }
211
+ throw new Error('获取socket授权失败');
212
+ case 5:
213
+ return _context.abrupt("return", res.socketToken);
214
+ case 6:
209
215
  case "end":
210
216
  return _context.stop();
211
217
  }
@@ -220,13 +226,10 @@ var SocketClient = /*#__PURE__*/function () {
220
226
  key: "open",
221
227
  value: function open(url, params) {
222
228
  var _this4 = this;
223
- this.getToken().then(function (res) {
224
- if (!res) {
225
- throw new Error('获取socket授权失败');
226
- }
229
+ this.getToken().then(function (token) {
227
230
  _this4.params = params || _this4.params;
228
231
  if (_this4.client) _this4.close();
229
- var paramUrl = [];
232
+ var paramUrl = ["socketToken=".concat(token)];
230
233
  if (_this4.params) {
231
234
  Object.keys(_this4.params || {}).forEach(function (key) {
232
235
  if (_.isObject(_this4.params[key]) || _.isArray(_this4.params[key])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.29-visual.7",
3
+ "version": "1.1.29-visual.8",
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": "0d22608428c02690fec4f51be172d62b7b979cb6"
62
+ "gitHead": "c8096f135cf883b041a3bb55cd6b3e7b6e85cc12"
63
63
  }