xydata-tools 1.1.33 → 1.1.34

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.
@@ -166,14 +166,14 @@ var fetchSSO = /*#__PURE__*/function () {
166
166
  */
167
167
  var ssoTypeByOld = /*#__PURE__*/function () {
168
168
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
169
- var urlParams, code, commonHeaders, response, data, token;
169
+ var urlParams, code, commonHeaders, response, data;
170
170
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
171
171
  while (1) switch (_context3.prev = _context3.next) {
172
172
  case 0:
173
173
  urlParams = new URLSearchParams(window.location.search);
174
174
  code = urlParams.get('code');
175
175
  if (!code) {
176
- _context3.next = 21;
176
+ _context3.next = 20;
177
177
  break;
178
178
  }
179
179
  commonHeaders = getCommonHeaders();
@@ -188,31 +188,30 @@ var ssoTypeByOld = /*#__PURE__*/function () {
188
188
  return response.json();
189
189
  case 10:
190
190
  data = _context3.sent;
191
- token = data.data;
192
- if (token) {
193
- saveTokenAndRedirect(token);
194
- } else if (data.rspCode !== '000000') {
195
- message.error(data.rspMsg);
191
+ if (data.access_token) {
192
+ saveTokenAndRedirect(data.access_token);
193
+ } else if (data.rspCode === '000000' && data.data) {
194
+ saveTokenAndRedirect(data.data);
196
195
  } else {
197
- message.error('token获取失败');
196
+ message.error(data.rspMsg || 'token获取失败');
198
197
  }
199
- _context3.next = 19;
198
+ _context3.next = 18;
200
199
  break;
201
- case 15:
202
- _context3.prev = 15;
200
+ case 14:
201
+ _context3.prev = 14;
203
202
  _context3.t0 = _context3["catch"](4);
204
203
  console.error('/auth/token 错误:', _context3.t0);
205
204
  message.error('网络请求失败,请稍后重试');
206
- case 19:
207
- _context3.next = 22;
205
+ case 18:
206
+ _context3.next = 21;
208
207
  break;
209
- case 21:
208
+ case 20:
210
209
  fetchSSO();
211
- case 22:
210
+ case 21:
212
211
  case "end":
213
212
  return _context3.stop();
214
213
  }
215
- }, _callee3, null, [[4, 15]]);
214
+ }, _callee3, null, [[4, 14]]);
216
215
  }));
217
216
  return function ssoTypeByOld() {
218
217
  return _ref3.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xydata-tools",
3
- "version": "1.1.33",
3
+ "version": "1.1.34",
4
4
  "description": "xydata tools",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -61,9 +61,9 @@
61
61
  "vue-template-compiler": "2.7.16"
62
62
  },
63
63
  "dependencies": {
64
- "@zhengxs/js.tree": "0.5.0",
64
+ "@zhengxs/js.tree": "0.5.0",
65
65
  "querystring": "0.2.1",
66
66
  "react-json-view": "^1.21.3",
67
67
  "styled-components": "4.4.1"
68
68
  }
69
- }
69
+ }