xydata-tools 1.1.32 → 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);
@@ -227,6 +226,7 @@ var removeSessionData = function removeSessionData() {
227
226
  removeSessionStorage('Token');
228
227
  removeSessionStorage('sso_redirect_url');
229
228
  };
229
+ var aaaLoginUrl = null;
230
230
 
231
231
  // ========== 组件定义 ==========
232
232
 
@@ -244,7 +244,7 @@ var XyAuthLayout = function XyAuthLayout(props) {
244
244
  var loginType = envData.login_type || 'BOTH';
245
245
  var pathName = window.location.pathname;
246
246
  var loginId = getQueryVariable('loginId');
247
- var aaaLoginUrl = envData.parent_login_url || "".concat(window.publicPath || '/', "user/login");
247
+ aaaLoginUrl = envData.parent_login_url || "".concat(window.publicPath || '/', "user/login");
248
248
  useEffect(function () {
249
249
  if (!token && !(loginId && ['BOTH', 'AAA'].includes(loginType))) {
250
250
  // 当登录方式为SSO_NEW或BOTH时,可在路径加上sso进行统一登陆,当登录方式固定为SSO或SSO_NEW时,直接跳转到SSO登录
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xydata-tools",
3
- "version": "1.1.32",
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
+ }