xydata-tools 1.0.52 → 1.1.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.
- package/dist/components/aaa/setting/role/index.js +38 -38
- package/dist/components/index.js +1 -0
- package/dist/components/securityLayout/index.js +341 -0
- package/dist/services/service.js +40 -2
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/securityLayout/index.d.ts +3 -0
- package/dist/types/components/uploadFile/index.d.ts +4 -0
- package/dist/utils/request.js +2 -2
- package/package.json +56 -52
|
@@ -17,14 +17,14 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
18
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
19
19
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
20
|
-
import { PlusOutlined, ExclamationCircleOutlined } from
|
|
21
|
-
import { Button, Divider, message, Modal, Checkbox, Col, Row } from
|
|
22
|
-
import React, { useState, useRef, useEffect } from
|
|
23
|
-
import ProTable from
|
|
24
|
-
;
|
|
20
|
+
import { PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
|
21
|
+
import { Button, Divider, message, Modal, Checkbox, Col, Row } from 'antd';
|
|
22
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
23
|
+
import ProTable from '@ant-design/pro-table';
|
|
25
24
|
import Auth from "../../auth";
|
|
26
25
|
import UpdateForm from "./components/UpdateForm";
|
|
27
26
|
import { queryRole, updateRole, addRole, removeRole, assignPerm, getRolePerms, getPermList } from "./service";
|
|
27
|
+
|
|
28
28
|
/**
|
|
29
29
|
* 添加角色
|
|
30
30
|
* @param fields
|
|
@@ -36,15 +36,15 @@ var handleAdd = /*#__PURE__*/function () {
|
|
|
36
36
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37
37
|
while (1) switch (_context.prev = _context.next) {
|
|
38
38
|
case 0:
|
|
39
|
-
hide = message.loading(
|
|
39
|
+
hide = message.loading('正在添加');
|
|
40
40
|
isSuccess = false;
|
|
41
41
|
_context.prev = 2;
|
|
42
42
|
_context.next = 5;
|
|
43
43
|
return addRole(_objectSpread({}, fields));
|
|
44
44
|
case 5:
|
|
45
45
|
res = _context.sent;
|
|
46
|
-
if (res.rspCode ===
|
|
47
|
-
message.success(
|
|
46
|
+
if (res.rspCode === '000000') {
|
|
47
|
+
message.success('添加成功');
|
|
48
48
|
isSuccess = true;
|
|
49
49
|
} else {
|
|
50
50
|
message.error(res.rspMsg);
|
|
@@ -54,7 +54,7 @@ var handleAdd = /*#__PURE__*/function () {
|
|
|
54
54
|
case 9:
|
|
55
55
|
_context.prev = 9;
|
|
56
56
|
_context.t0 = _context["catch"](2);
|
|
57
|
-
message.error(
|
|
57
|
+
message.error('添加失败请重试!');
|
|
58
58
|
case 12:
|
|
59
59
|
hide();
|
|
60
60
|
return _context.abrupt("return", isSuccess);
|
|
@@ -79,7 +79,7 @@ var handleUpdate = /*#__PURE__*/function () {
|
|
|
79
79
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
80
80
|
while (1) switch (_context2.prev = _context2.next) {
|
|
81
81
|
case 0:
|
|
82
|
-
hide = message.loading(
|
|
82
|
+
hide = message.loading('正在更新');
|
|
83
83
|
isSuccess = false;
|
|
84
84
|
_context2.prev = 2;
|
|
85
85
|
_context2.next = 5;
|
|
@@ -90,8 +90,8 @@ var handleUpdate = /*#__PURE__*/function () {
|
|
|
90
90
|
});
|
|
91
91
|
case 5:
|
|
92
92
|
res = _context2.sent;
|
|
93
|
-
if (res.rspCode ===
|
|
94
|
-
message.success(
|
|
93
|
+
if (res.rspCode === '000000') {
|
|
94
|
+
message.success('更新成功');
|
|
95
95
|
isSuccess = true;
|
|
96
96
|
} else {
|
|
97
97
|
message.error(res.rspMsg);
|
|
@@ -101,7 +101,7 @@ var handleUpdate = /*#__PURE__*/function () {
|
|
|
101
101
|
case 9:
|
|
102
102
|
_context2.prev = 9;
|
|
103
103
|
_context2.t0 = _context2["catch"](2);
|
|
104
|
-
message.error(
|
|
104
|
+
message.error('更新失败请重试!');
|
|
105
105
|
case 12:
|
|
106
106
|
hide();
|
|
107
107
|
return _context2.abrupt("return", isSuccess);
|
|
@@ -126,15 +126,15 @@ var handleRemove = /*#__PURE__*/function () {
|
|
|
126
126
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
127
127
|
while (1) switch (_context3.prev = _context3.next) {
|
|
128
128
|
case 0:
|
|
129
|
-
hide = message.loading(
|
|
129
|
+
hide = message.loading('正在删除');
|
|
130
130
|
isSuccess = false;
|
|
131
131
|
_context3.prev = 2;
|
|
132
132
|
_context3.next = 5;
|
|
133
133
|
return removeRole(record);
|
|
134
134
|
case 5:
|
|
135
135
|
res = _context3.sent;
|
|
136
|
-
if (res.rspCode ===
|
|
137
|
-
message.success(
|
|
136
|
+
if (res.rspCode === '000000') {
|
|
137
|
+
message.success('删除成功');
|
|
138
138
|
isSuccess = true;
|
|
139
139
|
} else {
|
|
140
140
|
message.error(res.rspMsg);
|
|
@@ -145,7 +145,7 @@ var handleRemove = /*#__PURE__*/function () {
|
|
|
145
145
|
_context3.prev = 9;
|
|
146
146
|
_context3.t0 = _context3["catch"](2);
|
|
147
147
|
hide();
|
|
148
|
-
message.error(
|
|
148
|
+
message.error('删除失败,请重试');
|
|
149
149
|
case 13:
|
|
150
150
|
hide();
|
|
151
151
|
return _context3.abrupt("return", isSuccess);
|
|
@@ -199,12 +199,12 @@ var RoleList = function RoleList() {
|
|
|
199
199
|
return getPermList({});
|
|
200
200
|
case 3:
|
|
201
201
|
res = _context4.sent;
|
|
202
|
-
if (res.rspCode ===
|
|
202
|
+
if (res.rspCode === '000000') {
|
|
203
203
|
dataVal = res.data;
|
|
204
204
|
arr = [];
|
|
205
205
|
dataVal.forEach(function (ele, index) {
|
|
206
206
|
if (!ele.moduleName) {
|
|
207
|
-
arr.push(
|
|
207
|
+
arr.push('其他');
|
|
208
208
|
} else {
|
|
209
209
|
arr.unshift(ele.moduleName);
|
|
210
210
|
}
|
|
@@ -215,7 +215,7 @@ var RoleList = function RoleList() {
|
|
|
215
215
|
var str = {
|
|
216
216
|
moduleName: e,
|
|
217
217
|
permList: dataVal.filter(function (ele) {
|
|
218
|
-
return ele.moduleName === e || ele.moduleName === null && e ===
|
|
218
|
+
return ele.moduleName === e || ele.moduleName === null && e === '其他';
|
|
219
219
|
})
|
|
220
220
|
};
|
|
221
221
|
tree.push(str);
|
|
@@ -230,7 +230,7 @@ var RoleList = function RoleList() {
|
|
|
230
230
|
_context4.prev = 7;
|
|
231
231
|
_context4.t0 = _context4["catch"](0);
|
|
232
232
|
console.log(_context4.t0);
|
|
233
|
-
message.error(
|
|
233
|
+
message.error('获取权限列表失败');
|
|
234
234
|
case 11:
|
|
235
235
|
case "end":
|
|
236
236
|
return _context4.stop();
|
|
@@ -242,20 +242,20 @@ var RoleList = function RoleList() {
|
|
|
242
242
|
};
|
|
243
243
|
}();
|
|
244
244
|
var columns = [{
|
|
245
|
-
title:
|
|
246
|
-
dataIndex:
|
|
245
|
+
title: '角色代码',
|
|
246
|
+
dataIndex: 'roleCode',
|
|
247
247
|
rules: [{
|
|
248
248
|
required: true,
|
|
249
|
-
message:
|
|
249
|
+
message: '角色代码为必填项'
|
|
250
250
|
}]
|
|
251
251
|
}, {
|
|
252
|
-
title:
|
|
253
|
-
dataIndex:
|
|
254
|
-
valueType:
|
|
252
|
+
title: '角色名称',
|
|
253
|
+
dataIndex: 'roleName',
|
|
254
|
+
valueType: 'textarea'
|
|
255
255
|
}, {
|
|
256
|
-
title:
|
|
257
|
-
dataIndex:
|
|
258
|
-
valueType:
|
|
256
|
+
title: '操作',
|
|
257
|
+
dataIndex: 'option',
|
|
258
|
+
valueType: 'option',
|
|
259
259
|
render: function render(_, record, index, action) {
|
|
260
260
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Auth, {
|
|
261
261
|
code: "ROLE_EDIT"
|
|
@@ -271,9 +271,9 @@ var RoleList = function RoleList() {
|
|
|
271
271
|
}, /*#__PURE__*/React.createElement("a", {
|
|
272
272
|
onClick: function onClick() {
|
|
273
273
|
Modal.confirm({
|
|
274
|
-
title:
|
|
274
|
+
title: '确定删除吗?',
|
|
275
275
|
icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
|
|
276
|
-
content:
|
|
276
|
+
content: '',
|
|
277
277
|
onOk: function () {
|
|
278
278
|
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
279
279
|
var success;
|
|
@@ -317,7 +317,7 @@ var RoleList = function RoleList() {
|
|
|
317
317
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
318
318
|
while (1) switch (_context6.prev = _context6.next) {
|
|
319
319
|
case 0:
|
|
320
|
-
hide = message.loading(
|
|
320
|
+
hide = message.loading('正在获取权限信息');
|
|
321
321
|
_context6.prev = 1;
|
|
322
322
|
_context6.next = 4;
|
|
323
323
|
return getRolePerms({
|
|
@@ -325,7 +325,7 @@ var RoleList = function RoleList() {
|
|
|
325
325
|
});
|
|
326
326
|
case 4:
|
|
327
327
|
res = _context6.sent;
|
|
328
|
-
if (res.rspCode ===
|
|
328
|
+
if (res.rspCode === '000000') {
|
|
329
329
|
_permList = res.data.map(function (e) {
|
|
330
330
|
return e.permId;
|
|
331
331
|
});
|
|
@@ -341,7 +341,7 @@ var RoleList = function RoleList() {
|
|
|
341
341
|
case 8:
|
|
342
342
|
_context6.prev = 8;
|
|
343
343
|
_context6.t0 = _context6["catch"](1);
|
|
344
|
-
message.error(
|
|
344
|
+
message.error('获取角色权限失败');
|
|
345
345
|
case 11:
|
|
346
346
|
hide();
|
|
347
347
|
case 12:
|
|
@@ -498,8 +498,8 @@ var RoleList = function RoleList() {
|
|
|
498
498
|
});
|
|
499
499
|
case 3:
|
|
500
500
|
res = _context10.sent;
|
|
501
|
-
if (res.rspCode ===
|
|
502
|
-
message.success(
|
|
501
|
+
if (res.rspCode === '000000') {
|
|
502
|
+
message.success('设置成功');
|
|
503
503
|
setPermModalVisible(false);
|
|
504
504
|
} else {
|
|
505
505
|
message.error(res.rspMsg);
|
|
@@ -509,7 +509,7 @@ var RoleList = function RoleList() {
|
|
|
509
509
|
case 7:
|
|
510
510
|
_context10.prev = 7;
|
|
511
511
|
_context10.t0 = _context10["catch"](0);
|
|
512
|
-
message.error(
|
|
512
|
+
message.error('设置权限失败');
|
|
513
513
|
case 10:
|
|
514
514
|
case "end":
|
|
515
515
|
return _context10.stop();
|
package/dist/components/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { default as OrganizationFront } from "./organization";
|
|
|
3
3
|
export { default as Sso } from "./sso";
|
|
4
4
|
export { default as Aaa } from "./aaa";
|
|
5
5
|
export { default as BothSecurityLayout } from "./both";
|
|
6
|
+
export { default as SecurityLayout, logout } from "./securityLayout";
|
|
6
7
|
export { default as UploadFile } from "./uploadFile";
|
|
7
8
|
export { default as DownloadFile } from "./downloadFile";
|
|
8
9
|
export { default as Version } from "./tools/version";
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import React, { useEffect } from 'react';
|
|
6
|
+
import { getSessionStorage, setSessionStorage, removeSessionStorage } from "../../utils/token.js";
|
|
7
|
+
import { message, Spin } from 'antd';
|
|
8
|
+
import { queryAaaCurrent, queryCurrent, accountLogout, accountAAALogout } from "../../services/service.js";
|
|
9
|
+
var SecurityLayout = function SecurityLayout(props) {
|
|
10
|
+
var children = props.children,
|
|
11
|
+
propsEnvData = props.envData,
|
|
12
|
+
propsService = props.service,
|
|
13
|
+
getUserOk = props.getUserOk,
|
|
14
|
+
getUserError = props.getUserError;
|
|
15
|
+
// 安全解析 JSON,避免解析异常
|
|
16
|
+
var getEnvData = function getEnvData() {
|
|
17
|
+
if (propsEnvData) return propsEnvData;
|
|
18
|
+
var envDataStr = getSessionStorage('env_data');
|
|
19
|
+
if (!envDataStr) return {};
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(envDataStr);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.error('解析 env_data 失败:', e);
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var envData = getEnvData();
|
|
28
|
+
var service = propsService || getSessionStorage('service');
|
|
29
|
+
var token = getSessionStorage('Token');
|
|
30
|
+
var propsLoginType = props.loginType || 'BOTH';
|
|
31
|
+
var pathName = window.location.pathname;
|
|
32
|
+
|
|
33
|
+
// 通用请求头参数
|
|
34
|
+
var commonHeaders = {
|
|
35
|
+
SID: SID,
|
|
36
|
+
service: service
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// 统一的错误处理
|
|
40
|
+
var handleError = function handleError(error) {
|
|
41
|
+
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
42
|
+
console.error(context ? "".concat(context, ":") : '错误:', error);
|
|
43
|
+
message.error('网络请求失败,请稍后重试');
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// 保存 Token 并跳转
|
|
47
|
+
var saveTokenAndRedirect = function saveTokenAndRedirect(token) {
|
|
48
|
+
setSessionStorage('Token', token);
|
|
49
|
+
var redirectUrl = getSessionStorage('sso_redirect_url');
|
|
50
|
+
if (redirectUrl) {
|
|
51
|
+
window.location.href = redirectUrl;
|
|
52
|
+
} else {
|
|
53
|
+
message.error('统一登陆跳转异常');
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
if (!token) {
|
|
58
|
+
// 当登录方式设为两端登录时,可在路径加上sso进行统一登陆,当登录方式固定为SSO时,直接跳转到SSO登录
|
|
59
|
+
if (propsLoginType === 'BOTH' && pathName.indexOf('/sso') >= 0 || propsLoginType === 'SSO') {
|
|
60
|
+
setSessionStorage('sso_redirect_url', window.location.href);
|
|
61
|
+
envData.sso_type === 'new' ? ssoTypeByNew() : ssoTypeByOld();
|
|
62
|
+
} else {
|
|
63
|
+
// 其他情况跳转到AAA登录
|
|
64
|
+
window.location.href = "".concat(window.publicPath, "user/login");
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
getUserinfo();
|
|
68
|
+
}
|
|
69
|
+
}, []);
|
|
70
|
+
var getUserinfo = /*#__PURE__*/function () {
|
|
71
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
72
|
+
var response;
|
|
73
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
74
|
+
while (1) switch (_context.prev = _context.next) {
|
|
75
|
+
case 0:
|
|
76
|
+
_context.prev = 0;
|
|
77
|
+
if (!(propsLoginType === 'SSO')) {
|
|
78
|
+
_context.next = 7;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
_context.next = 4;
|
|
82
|
+
return queryCurrent({});
|
|
83
|
+
case 4:
|
|
84
|
+
_context.t0 = _context.sent;
|
|
85
|
+
_context.next = 10;
|
|
86
|
+
break;
|
|
87
|
+
case 7:
|
|
88
|
+
_context.next = 9;
|
|
89
|
+
return queryAaaCurrent({});
|
|
90
|
+
case 9:
|
|
91
|
+
_context.t0 = _context.sent;
|
|
92
|
+
case 10:
|
|
93
|
+
response = _context.t0;
|
|
94
|
+
if (response.rspCode === '000000') {
|
|
95
|
+
getUserOk && getUserOk(response.data);
|
|
96
|
+
} else {
|
|
97
|
+
getUserError && getUserError(response);
|
|
98
|
+
}
|
|
99
|
+
_context.next = 17;
|
|
100
|
+
break;
|
|
101
|
+
case 14:
|
|
102
|
+
_context.prev = 14;
|
|
103
|
+
_context.t1 = _context["catch"](0);
|
|
104
|
+
getUserError && getUserError(_context.t1);
|
|
105
|
+
case 17:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context.stop();
|
|
108
|
+
}
|
|
109
|
+
}, _callee, null, [[0, 14]]);
|
|
110
|
+
}));
|
|
111
|
+
return function getUserinfo() {
|
|
112
|
+
return _ref.apply(this, arguments);
|
|
113
|
+
};
|
|
114
|
+
}();
|
|
115
|
+
var ssoTypeByNew = /*#__PURE__*/function () {
|
|
116
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
117
|
+
var response, result, href;
|
|
118
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
119
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
_context2.prev = 0;
|
|
122
|
+
_context2.next = 3;
|
|
123
|
+
return fetch('/auth/login', {
|
|
124
|
+
headers: commonHeaders,
|
|
125
|
+
method: 'POST'
|
|
126
|
+
});
|
|
127
|
+
case 3:
|
|
128
|
+
response = _context2.sent;
|
|
129
|
+
_context2.next = 6;
|
|
130
|
+
return response.json();
|
|
131
|
+
case 6:
|
|
132
|
+
result = _context2.sent;
|
|
133
|
+
if (result.rspCode === '000000') {
|
|
134
|
+
saveTokenAndRedirect(result.data);
|
|
135
|
+
} else {
|
|
136
|
+
message.error(result.rspMsg);
|
|
137
|
+
if (result.data) {
|
|
138
|
+
href = result.data + '?callback=' + encodeURIComponent(window.location.href);
|
|
139
|
+
setTimeout(function () {
|
|
140
|
+
window.location.href = href;
|
|
141
|
+
}, 1000);
|
|
142
|
+
} else if (result.rspCode === '999000') {
|
|
143
|
+
// 服务器响应超时
|
|
144
|
+
location.reload();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
_context2.next = 13;
|
|
148
|
+
break;
|
|
149
|
+
case 10:
|
|
150
|
+
_context2.prev = 10;
|
|
151
|
+
_context2.t0 = _context2["catch"](0);
|
|
152
|
+
handleError(_context2.t0, '/auth/login');
|
|
153
|
+
case 13:
|
|
154
|
+
case "end":
|
|
155
|
+
return _context2.stop();
|
|
156
|
+
}
|
|
157
|
+
}, _callee2, null, [[0, 10]]);
|
|
158
|
+
}));
|
|
159
|
+
return function ssoTypeByNew() {
|
|
160
|
+
return _ref2.apply(this, arguments);
|
|
161
|
+
};
|
|
162
|
+
}();
|
|
163
|
+
var fetchSSO = /*#__PURE__*/function () {
|
|
164
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
165
|
+
var response, data;
|
|
166
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
167
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
168
|
+
case 0:
|
|
169
|
+
_context3.prev = 0;
|
|
170
|
+
_context3.next = 3;
|
|
171
|
+
return fetch('/auth/sso', {
|
|
172
|
+
headers: commonHeaders
|
|
173
|
+
});
|
|
174
|
+
case 3:
|
|
175
|
+
response = _context3.sent;
|
|
176
|
+
if (!(response.status === 200)) {
|
|
177
|
+
_context3.next = 11;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
_context3.next = 7;
|
|
181
|
+
return response.text();
|
|
182
|
+
case 7:
|
|
183
|
+
data = _context3.sent;
|
|
184
|
+
window.location.href = data;
|
|
185
|
+
_context3.next = 12;
|
|
186
|
+
break;
|
|
187
|
+
case 11:
|
|
188
|
+
message.error('接口异常,请联系管理员');
|
|
189
|
+
case 12:
|
|
190
|
+
_context3.next = 17;
|
|
191
|
+
break;
|
|
192
|
+
case 14:
|
|
193
|
+
_context3.prev = 14;
|
|
194
|
+
_context3.t0 = _context3["catch"](0);
|
|
195
|
+
handleError(_context3.t0, '/auth/sso');
|
|
196
|
+
case 17:
|
|
197
|
+
case "end":
|
|
198
|
+
return _context3.stop();
|
|
199
|
+
}
|
|
200
|
+
}, _callee3, null, [[0, 14]]);
|
|
201
|
+
}));
|
|
202
|
+
return function fetchSSO() {
|
|
203
|
+
return _ref3.apply(this, arguments);
|
|
204
|
+
};
|
|
205
|
+
}();
|
|
206
|
+
var ssoTypeByOld = /*#__PURE__*/function () {
|
|
207
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
208
|
+
var urlParams, code, response, data, _token;
|
|
209
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
210
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
211
|
+
case 0:
|
|
212
|
+
urlParams = new URLSearchParams(window.location.search);
|
|
213
|
+
code = urlParams.get('code');
|
|
214
|
+
if (!code) {
|
|
215
|
+
_context4.next = 19;
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
_context4.prev = 3;
|
|
219
|
+
_context4.next = 6;
|
|
220
|
+
return fetch('/auth/token?code=' + encodeURIComponent(code), {
|
|
221
|
+
headers: commonHeaders
|
|
222
|
+
});
|
|
223
|
+
case 6:
|
|
224
|
+
response = _context4.sent;
|
|
225
|
+
_context4.next = 9;
|
|
226
|
+
return response.json();
|
|
227
|
+
case 9:
|
|
228
|
+
data = _context4.sent;
|
|
229
|
+
_token = data.access_token || (data.rspCode === '000000' ? data.data : null);
|
|
230
|
+
if (_token) {
|
|
231
|
+
saveTokenAndRedirect(_token);
|
|
232
|
+
} else {
|
|
233
|
+
message.error(data.rspMsg);
|
|
234
|
+
}
|
|
235
|
+
_context4.next = 17;
|
|
236
|
+
break;
|
|
237
|
+
case 14:
|
|
238
|
+
_context4.prev = 14;
|
|
239
|
+
_context4.t0 = _context4["catch"](3);
|
|
240
|
+
handleError(_context4.t0, '/auth/token');
|
|
241
|
+
case 17:
|
|
242
|
+
_context4.next = 20;
|
|
243
|
+
break;
|
|
244
|
+
case 19:
|
|
245
|
+
fetchSSO();
|
|
246
|
+
case 20:
|
|
247
|
+
case "end":
|
|
248
|
+
return _context4.stop();
|
|
249
|
+
}
|
|
250
|
+
}, _callee4, null, [[3, 14]]);
|
|
251
|
+
}));
|
|
252
|
+
return function ssoTypeByOld() {
|
|
253
|
+
return _ref4.apply(this, arguments);
|
|
254
|
+
};
|
|
255
|
+
}();
|
|
256
|
+
|
|
257
|
+
// 加载状态
|
|
258
|
+
if (!token) {
|
|
259
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
260
|
+
style: {
|
|
261
|
+
display: 'flex',
|
|
262
|
+
justifyContent: 'center',
|
|
263
|
+
alignItems: 'center',
|
|
264
|
+
minHeight: '100vh'
|
|
265
|
+
}
|
|
266
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
267
|
+
size: "large"
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// 渲染子组件
|
|
272
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
273
|
+
};
|
|
274
|
+
export default SecurityLayout;
|
|
275
|
+
|
|
276
|
+
// 退出登录的工具函数
|
|
277
|
+
export var logout = /*#__PURE__*/function () {
|
|
278
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
279
|
+
var loginType,
|
|
280
|
+
actualLoginType,
|
|
281
|
+
redirectUrl,
|
|
282
|
+
response,
|
|
283
|
+
_args5 = arguments;
|
|
284
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
285
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
286
|
+
case 0:
|
|
287
|
+
loginType = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 'BOTH';
|
|
288
|
+
// 当 loginType 为 BOTH 时,根据 sessionStorage 中的 'sso_redirect_url' 判断实际登录方式
|
|
289
|
+
// 有 'sso_redirect_url' 说明使用的是 SSO 登录,否则是 AAA 登录
|
|
290
|
+
actualLoginType = loginType;
|
|
291
|
+
if (loginType === 'BOTH') {
|
|
292
|
+
redirectUrl = getSessionStorage('sso_redirect_url');
|
|
293
|
+
actualLoginType = redirectUrl ? 'SSO' : 'AAA';
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// 清理本地存储
|
|
297
|
+
removeSessionStorage('Token');
|
|
298
|
+
removeSessionStorage('sso_redirect_url');
|
|
299
|
+
if (!(actualLoginType === 'AAA')) {
|
|
300
|
+
_context5.next = 17;
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
_context5.prev = 6;
|
|
304
|
+
_context5.next = 9;
|
|
305
|
+
return accountAAALogout({});
|
|
306
|
+
case 9:
|
|
307
|
+
_context5.next = 14;
|
|
308
|
+
break;
|
|
309
|
+
case 11:
|
|
310
|
+
_context5.prev = 11;
|
|
311
|
+
_context5.t0 = _context5["catch"](6);
|
|
312
|
+
console.error('AAA 退出登录失败:', _context5.t0);
|
|
313
|
+
case 14:
|
|
314
|
+
window.location.href = "".concat(window.publicPath || '/', "user/login");
|
|
315
|
+
_context5.next = 27;
|
|
316
|
+
break;
|
|
317
|
+
case 17:
|
|
318
|
+
_context5.prev = 17;
|
|
319
|
+
_context5.next = 20;
|
|
320
|
+
return accountLogout({});
|
|
321
|
+
case 20:
|
|
322
|
+
response = _context5.sent;
|
|
323
|
+
if (response) {
|
|
324
|
+
window.location.href = response;
|
|
325
|
+
}
|
|
326
|
+
_context5.next = 27;
|
|
327
|
+
break;
|
|
328
|
+
case 24:
|
|
329
|
+
_context5.prev = 24;
|
|
330
|
+
_context5.t1 = _context5["catch"](17);
|
|
331
|
+
console.error('SSO 退出登录失败:', _context5.t1);
|
|
332
|
+
case 27:
|
|
333
|
+
case "end":
|
|
334
|
+
return _context5.stop();
|
|
335
|
+
}
|
|
336
|
+
}, _callee5, null, [[6, 11], [17, 24]]);
|
|
337
|
+
}));
|
|
338
|
+
return function logout() {
|
|
339
|
+
return _ref5.apply(this, arguments);
|
|
340
|
+
};
|
|
341
|
+
}();
|
package/dist/services/service.js
CHANGED
|
@@ -15,7 +15,7 @@ function _queryCurrent() {
|
|
|
15
15
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16
16
|
while (1) switch (_context.prev = _context.next) {
|
|
17
17
|
case 0:
|
|
18
|
-
return _context.abrupt("return", doRequest('/api/currentUser',
|
|
18
|
+
return _context.abrupt("return", doRequest('/api/currentUser', 'POST', params));
|
|
19
19
|
case 1:
|
|
20
20
|
case "end":
|
|
21
21
|
return _context.stop();
|
|
@@ -27,12 +27,14 @@ function _queryCurrent() {
|
|
|
27
27
|
export function queryAaaCurrent(_x2) {
|
|
28
28
|
return _queryAaaCurrent.apply(this, arguments);
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
// 退出登录 | sso
|
|
30
32
|
function _queryAaaCurrent() {
|
|
31
33
|
_queryAaaCurrent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
32
34
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
33
35
|
while (1) switch (_context2.prev = _context2.next) {
|
|
34
36
|
case 0:
|
|
35
|
-
return _context2.abrupt("return", doRequest('/api/aaa/current',
|
|
37
|
+
return _context2.abrupt("return", doRequest('/api/aaa/current', 'POST', params));
|
|
36
38
|
case 1:
|
|
37
39
|
case "end":
|
|
38
40
|
return _context2.stop();
|
|
@@ -40,4 +42,40 @@ function _queryAaaCurrent() {
|
|
|
40
42
|
}, _callee2);
|
|
41
43
|
}));
|
|
42
44
|
return _queryAaaCurrent.apply(this, arguments);
|
|
45
|
+
}
|
|
46
|
+
export function accountLogout(_x3) {
|
|
47
|
+
return _accountLogout.apply(this, arguments);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 退出登录 | aaa
|
|
51
|
+
function _accountLogout() {
|
|
52
|
+
_accountLogout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
53
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
54
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
55
|
+
case 0:
|
|
56
|
+
return _context3.abrupt("return", doRequest('/auth/logout', 'GET', params));
|
|
57
|
+
case 1:
|
|
58
|
+
case "end":
|
|
59
|
+
return _context3.stop();
|
|
60
|
+
}
|
|
61
|
+
}, _callee3);
|
|
62
|
+
}));
|
|
63
|
+
return _accountLogout.apply(this, arguments);
|
|
64
|
+
}
|
|
65
|
+
export function accountAAALogout(_x4) {
|
|
66
|
+
return _accountAAALogout.apply(this, arguments);
|
|
67
|
+
}
|
|
68
|
+
function _accountAAALogout() {
|
|
69
|
+
_accountAAALogout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
|
|
70
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
71
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
return _context4.abrupt("return", doRequest('/api/aaa/logout', 'GET', params));
|
|
74
|
+
case 1:
|
|
75
|
+
case "end":
|
|
76
|
+
return _context4.stop();
|
|
77
|
+
}
|
|
78
|
+
}, _callee4);
|
|
79
|
+
}));
|
|
80
|
+
return _accountAAALogout.apply(this, arguments);
|
|
43
81
|
}
|
|
@@ -7,3 +7,4 @@ export { default as UploadFile } from "./uploadFile";
|
|
|
7
7
|
export { default as DownloadFile } from "./downloadFile";
|
|
8
8
|
export { default as Version } from "./tools/version";
|
|
9
9
|
export { default as MaterialCard } from "./materialCard";
|
|
10
|
+
export { default as SecurityLayout, logout } from "./securityLayout";
|
|
@@ -51,3 +51,7 @@ declare function UploadFile(props: {
|
|
|
51
51
|
uploadOptions: UploadProps;
|
|
52
52
|
buttonOptions: ButtonProps;
|
|
53
53
|
}): JSX.Element;
|
|
54
|
+
import { FormProps } from "antd";
|
|
55
|
+
import { FormItemProps } from "antd";
|
|
56
|
+
import { UploadProps } from "antd";
|
|
57
|
+
import { ButtonProps } from "antd";
|
package/dist/utils/request.js
CHANGED
|
@@ -7,7 +7,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
-
import request from 'umi
|
|
10
|
+
import { request } from 'umi';
|
|
11
11
|
import { message } from 'antd';
|
|
12
12
|
import { getSessionStorage } from "./token.js";
|
|
13
13
|
import { history } from 'umi';
|
|
@@ -62,7 +62,7 @@ function _doRequest() {
|
|
|
62
62
|
_context.next = 8;
|
|
63
63
|
break;
|
|
64
64
|
case 7:
|
|
65
|
-
message.error(
|
|
65
|
+
message.error('服务器异常');
|
|
66
66
|
case 8:
|
|
67
67
|
return _context.abrupt("return", error.response);
|
|
68
68
|
case 9:
|
package/package.json
CHANGED
|
@@ -1,54 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
2
|
+
"name": "xydata-tools",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "xydata tools",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://172.16.1.252/wuxiaohu/xydata-tools.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://172.16.1.252/wuxiaohu/xydata-tools",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "father dev",
|
|
15
|
+
"build": "father build",
|
|
16
|
+
"generate-types": "tsc --emitDeclarationOnly --project tsconfig.json",
|
|
17
|
+
"prepublishOnly": "npm run build && npm run generate-types"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"authors": [],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"files": [
|
|
23
|
+
"/dist"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@ant-design/icons": "^4.5.0",
|
|
30
|
+
"@ant-design/pro-form": "^1.69.4",
|
|
31
|
+
"@ant-design/pro-table": "^2.80.8",
|
|
32
|
+
"antd": "^4.24.16",
|
|
33
|
+
"moment": "^2.30.1",
|
|
34
|
+
"react": "^17.0.0",
|
|
35
|
+
"react-dom": "^17.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@babel/core": "7.24.9",
|
|
39
|
+
"@babel/preset-env": "7.24.8",
|
|
40
|
+
"@babel/preset-react": "7.24.7",
|
|
41
|
+
"@vitejs/plugin-vue2": "2.3.1",
|
|
42
|
+
"father": "4.1.5",
|
|
43
|
+
"terser": "5.31.3",
|
|
44
|
+
"vue": "2.7.16",
|
|
45
|
+
"vue-loader": "15.11.1",
|
|
46
|
+
"vue-template-compiler": "2.7.16"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@ant-design/icons": "4.5.0",
|
|
50
|
+
"@ant-design/pro-form": "1.69.4",
|
|
51
|
+
"@ant-design/pro-table": "2.80.8",
|
|
52
|
+
"@zhengxs/js.tree": "0.5.0",
|
|
53
|
+
"compressorjs": "1.2.1",
|
|
54
|
+
"moment": "^2.30.1",
|
|
55
|
+
"querystring": "0.2.1",
|
|
56
|
+
"styled-components": "4.4.1"
|
|
57
|
+
}
|
|
54
58
|
}
|