xydata-tools 1.0.34 → 1.0.35

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.
@@ -10,7 +10,8 @@ var BothSecurityLayout = function BothSecurityLayout(props) {
10
10
  var children = props.children,
11
11
  propsEnvData = props.envData,
12
12
  propsService = props.service,
13
- getUserOk = props.getUserOk;
13
+ getUserOk = props.getUserOk,
14
+ getUserError = props.getUserError;
14
15
  var envData = propsEnvData || (getSessionStorage("env_data") ? JSON.parse(getSessionStorage("env_data")) : {});
15
16
  var service = propsService || getSessionStorage("service");
16
17
  var token = getSessionStorage("Token");
@@ -39,31 +40,40 @@ var BothSecurityLayout = function BothSecurityLayout(props) {
39
40
  return _regeneratorRuntime().wrap(function _callee$(_context) {
40
41
  while (1) switch (_context.prev = _context.next) {
41
42
  case 0:
43
+ _context.prev = 0;
42
44
  if (!AAALOGIN) {
43
- _context.next = 6;
45
+ _context.next = 7;
44
46
  break;
45
47
  }
46
- _context.next = 3;
48
+ _context.next = 4;
47
49
  return queryAaaCurrent({});
48
- case 3:
50
+ case 4:
49
51
  _context.t0 = _context.sent;
50
- _context.next = 9;
52
+ _context.next = 10;
51
53
  break;
52
- case 6:
53
- _context.next = 8;
54
+ case 7:
55
+ _context.next = 9;
54
56
  return queryCurrent({});
55
- case 8:
56
- _context.t0 = _context.sent;
57
57
  case 9:
58
+ _context.t0 = _context.sent;
59
+ case 10:
58
60
  response = _context.t0;
59
61
  if (response.rspCode === "000000") {
60
62
  getUserOk && getUserOk(response.data);
63
+ } else {
64
+ getUserError && getUserError(response);
61
65
  }
62
- case 11:
66
+ _context.next = 17;
67
+ break;
68
+ case 14:
69
+ _context.prev = 14;
70
+ _context.t1 = _context["catch"](0);
71
+ getUserError && getUserError(_context.t1);
72
+ case 17:
63
73
  case "end":
64
74
  return _context.stop();
65
75
  }
66
- }, _callee);
76
+ }, _callee, null, [[0, 14]]);
67
77
  }));
68
78
  return function getUserinfo() {
69
79
  return _ref.apply(this, arguments);
@@ -51,7 +51,7 @@ function _doRequest() {
51
51
  while (1) switch (_context.prev = _context.next) {
52
52
  case 0:
53
53
  if (!(error.response.status === 401 || error.response.status === 402 || error.response.status === 403)) {
54
- _context.next = 8;
54
+ _context.next = 7;
55
55
  break;
56
56
  }
57
57
  _context.next = 3;
@@ -59,16 +59,13 @@ function _doRequest() {
59
59
  case 3:
60
60
  _data = _context.sent;
61
61
  message.error(_data.rspMsg);
62
- if (_data.rspCode === '999008') {
63
- history.push('/user/login');
64
- }
65
- _context.next = 9;
62
+ _context.next = 8;
66
63
  break;
67
- case 8:
64
+ case 7:
68
65
  message.error("服务器异常");
69
- case 9:
66
+ case 8:
70
67
  return _context.abrupt("return", error.response);
71
- case 10:
68
+ case 9:
72
69
  case "end":
73
70
  return _context.stop();
74
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xydata-tools",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "xydata tools",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",