xydata-tools 1.1.1 → 1.1.3
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/sso/setting/permRole/index.js +20 -15
- package/dist/components/sso/setting/permission/index.js +73 -79
- package/dist/components/sso/setting/role/index.js +43 -42
- package/dist/components/sso/setting/user/index.js +34 -32
- package/dist/components/xyAuthLayout/index.js +44 -49
- package/dist/types/components/aaa/auth/index.d.ts +1 -1
- package/dist/types/components/aaa/setting/permission/components/UpdateForm.d.ts +1 -1
- package/dist/types/components/aaa/setting/permission/components/UriModal.d.ts +1 -1
- package/dist/types/components/aaa/setting/permission/index.d.ts +1 -1
- package/dist/types/components/aaa/setting/requesturl/components/UpdateForm.d.ts +1 -1
- package/dist/types/components/aaa/setting/requesturl/index.d.ts +1 -1
- package/dist/types/components/aaa/setting/role/components/UpdateForm.d.ts +1 -1
- package/dist/types/components/aaa/setting/role/index.d.ts +1 -1
- package/dist/types/components/aaa/setting/user/components/UpdateForm.d.ts +1 -1
- package/dist/types/components/aaa/setting/user/index.d.ts +1 -1
- package/dist/types/components/both/security-layout/index.d.ts +1 -1
- package/dist/types/components/dictionary/components/UpdateForm.d.ts +1 -1
- package/dist/types/components/dictionary/index.d.ts +1 -1
- package/dist/types/components/downloadFile/index.d.ts +1 -1
- package/dist/types/components/materialCard/index.d.ts +1 -1
- package/dist/types/components/organization/components/CreatePeopleForm.d.ts +1 -1
- package/dist/types/components/organization/components/CreateSubStoreForm.d.ts +1 -1
- package/dist/types/components/organization/components/OrgTree.d.ts +1 -1
- package/dist/types/components/organization/index.d.ts +1 -1
- package/dist/types/components/sso/security-layout/index.d.ts +1 -1
- package/dist/types/components/sso/setting/permRole/index.d.ts +2 -2
- package/dist/types/components/sso/setting/permission/components/UpdateForm.d.ts +1 -1
- package/dist/types/components/sso/setting/permission/index.d.ts +1 -1
- package/dist/types/components/sso/setting/role/components/UpdateForm.d.ts +1 -1
- package/dist/types/components/sso/setting/role/index.d.ts +2 -2
- package/dist/types/components/sso/setting/user/components/RoleUpdateForm.d.ts +1 -1
- package/dist/types/components/sso/setting/user/index.d.ts +2 -2
- package/dist/types/components/tools/version.d.ts +1 -1
- package/dist/types/components/uploadFile/index.d.ts +1 -1
- package/dist/types/components/xyAuthLayout/index.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +1 -1
- package/dist/utils/request.js +6 -10
- package/package.json +12 -6
|
@@ -12,14 +12,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
12
12
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
13
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
-
import React, { useEffect, useState } from
|
|
16
|
-
import { history } from
|
|
17
|
-
import { Row, Col, Card, Button, Divider, Checkbox } from
|
|
15
|
+
import React, { useEffect, useState } from 'react';
|
|
16
|
+
import { history } from 'umi';
|
|
17
|
+
import { Row, Col, Card, Button, Divider, Checkbox } from 'antd';
|
|
18
18
|
import { fetchPerms, saveRolePerms } from "../service.js";
|
|
19
19
|
import { asyncCallback } from "../../../../utils/utils.js";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
import { connect } from 'umi';
|
|
21
|
+
var PermRoleBoard = function PermRoleBoard(_ref) {
|
|
22
|
+
var currentUser = _ref.currentUser;
|
|
23
23
|
var _useState = useState([]),
|
|
24
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
25
|
roleperms = _useState2[0],
|
|
@@ -36,7 +36,7 @@ var PermRoleBoard = function PermRoleBoard(props) {
|
|
|
36
36
|
getInitData();
|
|
37
37
|
}, []);
|
|
38
38
|
var getInitData = /*#__PURE__*/function () {
|
|
39
|
-
var
|
|
39
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
40
40
|
var res, flag;
|
|
41
41
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
42
42
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -63,14 +63,14 @@ var PermRoleBoard = function PermRoleBoard(props) {
|
|
|
63
63
|
}, _callee);
|
|
64
64
|
}));
|
|
65
65
|
return function getInitData() {
|
|
66
|
-
return
|
|
66
|
+
return _ref2.apply(this, arguments);
|
|
67
67
|
};
|
|
68
68
|
}();
|
|
69
69
|
var rightAction = function rightAction() {
|
|
70
70
|
return /*#__PURE__*/React.createElement("span", {
|
|
71
71
|
style: {
|
|
72
|
-
display:
|
|
73
|
-
whiteSpace:
|
|
72
|
+
display: 'block',
|
|
73
|
+
whiteSpace: 'nowrap',
|
|
74
74
|
marginBottom: 24
|
|
75
75
|
}
|
|
76
76
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -87,7 +87,7 @@ var PermRoleBoard = function PermRoleBoard(props) {
|
|
|
87
87
|
}, "\u5173\u95ED"));
|
|
88
88
|
};
|
|
89
89
|
var handleShutdown = function handleShutdown() {
|
|
90
|
-
history.push(
|
|
90
|
+
history.push('/sso/role');
|
|
91
91
|
};
|
|
92
92
|
var onChange = function onChange(e) {
|
|
93
93
|
var newData = _toConsumableArray(roleperms);
|
|
@@ -106,7 +106,7 @@ var PermRoleBoard = function PermRoleBoard(props) {
|
|
|
106
106
|
});
|
|
107
107
|
};
|
|
108
108
|
var handleSubmit = /*#__PURE__*/function () {
|
|
109
|
-
var
|
|
109
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
110
110
|
var payload, res, flag;
|
|
111
111
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
112
112
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -135,7 +135,7 @@ var PermRoleBoard = function PermRoleBoard(props) {
|
|
|
135
135
|
}, _callee2);
|
|
136
136
|
}));
|
|
137
137
|
return function handleSubmit() {
|
|
138
|
-
return
|
|
138
|
+
return _ref3.apply(this, arguments);
|
|
139
139
|
};
|
|
140
140
|
}();
|
|
141
141
|
return /*#__PURE__*/React.createElement(Card, {
|
|
@@ -165,9 +165,14 @@ var PermRoleBoard = function PermRoleBoard(props) {
|
|
|
165
165
|
key: _.permId,
|
|
166
166
|
value: _.permId,
|
|
167
167
|
defaultChecked: _.roleId === null ? false : true,
|
|
168
|
-
disabled: !(currentUser.userType ===
|
|
168
|
+
disabled: !(currentUser.userType === 'ADMIN' || currentUser.userType === 'SUPERADMIN')
|
|
169
169
|
}, _.permName));
|
|
170
170
|
}))));
|
|
171
171
|
}));
|
|
172
172
|
};
|
|
173
|
-
export default
|
|
173
|
+
export default connect(function (_ref4) {
|
|
174
|
+
var user = _ref4.user;
|
|
175
|
+
return {
|
|
176
|
+
currentUser: user.currentUser
|
|
177
|
+
};
|
|
178
|
+
})(PermRoleBoard);
|
|
@@ -15,11 +15,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
15
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
17
|
import { asyncCallback } from "../../../../utils/utils.js";
|
|
18
|
-
import { PlusOutlined } from
|
|
19
|
-
import ProTable from
|
|
20
|
-
;
|
|
21
|
-
import
|
|
22
|
-
import React, { useRef, useState } from "react";
|
|
18
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
19
|
+
import ProTable from '@ant-design/pro-table';
|
|
20
|
+
import { Button, Card, Divider, Modal, Space } from 'antd';
|
|
21
|
+
import React, { useRef, useState } from 'react';
|
|
23
22
|
import { addPerm, queryPerm, removePerm, updatePerm } from "../service.js";
|
|
24
23
|
import UpdateForm from "./components/UpdateForm";
|
|
25
24
|
import styles from "./styles.less";
|
|
@@ -32,32 +31,32 @@ var PermList = function PermList() {
|
|
|
32
31
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
32
|
itemValues = _useState4[0],
|
|
34
33
|
setItemValues = _useState4[1];
|
|
35
|
-
var _useState5 = useState(
|
|
34
|
+
var _useState5 = useState('create'),
|
|
36
35
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
36
|
formType = _useState6[0],
|
|
38
37
|
setFormType = _useState6[1];
|
|
39
38
|
var actionRef = useRef();
|
|
40
39
|
var columns = [{
|
|
41
|
-
title:
|
|
42
|
-
dataIndex:
|
|
40
|
+
title: '名称',
|
|
41
|
+
dataIndex: 'keyString',
|
|
43
42
|
hideInTable: true,
|
|
44
43
|
fieldProps: {
|
|
45
|
-
placeholder:
|
|
44
|
+
placeholder: '请输入'
|
|
46
45
|
}
|
|
47
46
|
}, {
|
|
48
|
-
title:
|
|
47
|
+
title: '模块',
|
|
49
48
|
hideInSearch: true,
|
|
50
|
-
dataIndex:
|
|
49
|
+
dataIndex: 'permModule'
|
|
51
50
|
}, {
|
|
52
|
-
title:
|
|
51
|
+
title: '编码',
|
|
53
52
|
hideInSearch: true,
|
|
54
|
-
dataIndex:
|
|
53
|
+
dataIndex: 'permCode'
|
|
55
54
|
}, {
|
|
56
|
-
title:
|
|
55
|
+
title: '名称',
|
|
57
56
|
hideInSearch: true,
|
|
58
|
-
dataIndex:
|
|
57
|
+
dataIndex: 'permName'
|
|
59
58
|
}, {
|
|
60
|
-
title:
|
|
59
|
+
title: '操作',
|
|
61
60
|
hideInSearch: true,
|
|
62
61
|
className: styles.minw110,
|
|
63
62
|
render: function render(text, record) {
|
|
@@ -79,10 +78,10 @@ var PermList = function PermList() {
|
|
|
79
78
|
}];
|
|
80
79
|
var handleRemove = function handleRemove(record) {
|
|
81
80
|
Modal.confirm({
|
|
82
|
-
title:
|
|
83
|
-
content:
|
|
84
|
-
okText:
|
|
85
|
-
cancelText:
|
|
81
|
+
title: '警告',
|
|
82
|
+
content: '确定删除吗?',
|
|
83
|
+
okText: '确认',
|
|
84
|
+
cancelText: '取消',
|
|
86
85
|
onOk: function onOk() {
|
|
87
86
|
onSubmitRemove(record);
|
|
88
87
|
}
|
|
@@ -120,7 +119,7 @@ var PermList = function PermList() {
|
|
|
120
119
|
var handleModalVisible = function handleModalVisible(flag, record) {
|
|
121
120
|
var itemVal = record === undefined ? {} : record;
|
|
122
121
|
setItemValues(itemVal);
|
|
123
|
-
var type = record === undefined ?
|
|
122
|
+
var type = record === undefined ? 'create' : 'update';
|
|
124
123
|
setFormType(type);
|
|
125
124
|
toggleModalVisible(!!flag);
|
|
126
125
|
};
|
|
@@ -184,7 +183,7 @@ var PermList = function PermList() {
|
|
|
184
183
|
}();
|
|
185
184
|
var handleCancel = function handleCancel() {
|
|
186
185
|
setItemValues({});
|
|
187
|
-
setFormType(
|
|
186
|
+
setFormType('');
|
|
188
187
|
toggleModalVisible(false);
|
|
189
188
|
};
|
|
190
189
|
var parentMethods = {
|
|
@@ -192,62 +191,57 @@ var PermList = function PermList() {
|
|
|
192
191
|
handleUpdate: handleUpdate,
|
|
193
192
|
onCancel: handleCancel
|
|
194
193
|
};
|
|
195
|
-
return (
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
currentItem: itemValues,
|
|
248
|
-
formType: formType
|
|
249
|
-
})) : null))
|
|
250
|
-
// </PageHeaderWrapper>
|
|
251
|
-
);
|
|
194
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: styles.tableList
|
|
196
|
+
}, /*#__PURE__*/React.createElement(ProTable, {
|
|
197
|
+
headerTitle: "\u6743\u9650\u5217\u8868",
|
|
198
|
+
actionRef: actionRef,
|
|
199
|
+
rowKey: "id",
|
|
200
|
+
toolBarRender: function toolBarRender() {
|
|
201
|
+
return [/*#__PURE__*/React.createElement(Button, {
|
|
202
|
+
type: "danger",
|
|
203
|
+
onClick: function onClick() {
|
|
204
|
+
return handleModalVisible(true);
|
|
205
|
+
},
|
|
206
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
|
|
207
|
+
}, "\u65B0\u5EFA")];
|
|
208
|
+
},
|
|
209
|
+
request: ( /*#__PURE__*/function () {
|
|
210
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
|
|
211
|
+
var data;
|
|
212
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
213
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
214
|
+
case 0:
|
|
215
|
+
_context4.next = 2;
|
|
216
|
+
return queryPerm(_objectSpread(_objectSpread({}, params), {}, {
|
|
217
|
+
page: params.current
|
|
218
|
+
}));
|
|
219
|
+
case 2:
|
|
220
|
+
data = _context4.sent;
|
|
221
|
+
return _context4.abrupt("return", {
|
|
222
|
+
data: data.data.list,
|
|
223
|
+
success: true,
|
|
224
|
+
total: data.data.total
|
|
225
|
+
});
|
|
226
|
+
case 4:
|
|
227
|
+
case "end":
|
|
228
|
+
return _context4.stop();
|
|
229
|
+
}
|
|
230
|
+
}, _callee4);
|
|
231
|
+
}));
|
|
232
|
+
return function (_x4) {
|
|
233
|
+
return _ref4.apply(this, arguments);
|
|
234
|
+
};
|
|
235
|
+
}()),
|
|
236
|
+
pagination: {
|
|
237
|
+
showSizeChanger: true
|
|
238
|
+
},
|
|
239
|
+
columns: columns,
|
|
240
|
+
rowSelection: false
|
|
241
|
+
}), modalVisible ? /*#__PURE__*/React.createElement(UpdateForm, _extends({}, parentMethods, {
|
|
242
|
+
modalVisible: modalVisible,
|
|
243
|
+
currentItem: itemValues,
|
|
244
|
+
formType: formType
|
|
245
|
+
})) : null);
|
|
252
246
|
};
|
|
253
247
|
export default PermList;
|
|
@@ -14,18 +14,18 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
14
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import React, { useState, useRef } from "react";
|
|
18
|
-
import { history } from "umi";
|
|
19
|
-
import { Card, Form, Button, Modal, Divider, Space } from "antd";
|
|
20
|
-
import styles from "./styles.less";
|
|
21
|
-
import { PlusOutlined } from "@ant-design/icons";
|
|
22
|
-
import UpdateForm from "./components/UpdateForm";
|
|
23
|
-
import { addRole, queryRole, removeRole, updateRole } from "../service.js";
|
|
24
17
|
import { asyncCallback } from "../../../../utils/utils.js";
|
|
25
|
-
import
|
|
26
|
-
;
|
|
18
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
19
|
+
import ProTable from '@ant-design/pro-table';
|
|
20
|
+
import { Button, Divider, Form, Modal, Space } from 'antd';
|
|
21
|
+
import { useRef, useState } from 'react';
|
|
22
|
+
import { connect, history } from 'umi';
|
|
23
|
+
import { addRole, queryRole, removeRole, updateRole } from "../service.js";
|
|
24
|
+
import UpdateForm from "./components/UpdateForm";
|
|
25
|
+
import styles from "./styles.less";
|
|
27
26
|
var PAGE_SIZE = 10;
|
|
28
|
-
var RoleList = function RoleList(
|
|
27
|
+
var RoleList = function RoleList(_ref) {
|
|
28
|
+
var currentUser = _ref.currentUser;
|
|
29
29
|
var _Form$useForm = Form.useForm(),
|
|
30
30
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
31
31
|
form = _Form$useForm2[0];
|
|
@@ -37,33 +37,32 @@ var RoleList = function RoleList(props) {
|
|
|
37
37
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
38
|
itemValues = _useState4[0],
|
|
39
39
|
setItemValues = _useState4[1];
|
|
40
|
-
var _useState5 = useState(
|
|
40
|
+
var _useState5 = useState('create'),
|
|
41
41
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
42
|
formType = _useState6[0],
|
|
43
43
|
setFormType = _useState6[1];
|
|
44
44
|
var actionRef = useRef();
|
|
45
|
-
var currentUser = props.currentUser;
|
|
46
45
|
var columns = [{
|
|
47
|
-
title:
|
|
48
|
-
dataIndex:
|
|
46
|
+
title: '查询内容',
|
|
47
|
+
dataIndex: 'keyString',
|
|
49
48
|
hideInTable: true,
|
|
50
49
|
fieldProps: {
|
|
51
|
-
placeholder:
|
|
50
|
+
placeholder: '请输入名称'
|
|
52
51
|
}
|
|
53
52
|
}, {
|
|
54
|
-
title:
|
|
55
|
-
dataIndex:
|
|
53
|
+
title: '编码',
|
|
54
|
+
dataIndex: 'roleCode',
|
|
56
55
|
hideInSearch: true
|
|
57
56
|
}, {
|
|
58
|
-
title:
|
|
59
|
-
dataIndex:
|
|
57
|
+
title: '名称',
|
|
58
|
+
dataIndex: 'roleName',
|
|
60
59
|
hideInSearch: true
|
|
61
60
|
}, {
|
|
62
|
-
title:
|
|
61
|
+
title: '操作',
|
|
63
62
|
className: styles.w180,
|
|
64
63
|
hideInSearch: true,
|
|
65
64
|
render: function render(text, record) {
|
|
66
|
-
if (currentUser.userType ===
|
|
65
|
+
if (currentUser.userType === 'ADMIN' || currentUser.userType === 'SUPERADMIN') {
|
|
67
66
|
return /*#__PURE__*/React.createElement(Space, {
|
|
68
67
|
split: /*#__PURE__*/React.createElement(Divider, {
|
|
69
68
|
type: "vertical"
|
|
@@ -95,7 +94,7 @@ var RoleList = function RoleList(props) {
|
|
|
95
94
|
}];
|
|
96
95
|
var handleSetAbility = function handleSetAbility(record) {
|
|
97
96
|
history.push({
|
|
98
|
-
pathname:
|
|
97
|
+
pathname: '/sso/permrole',
|
|
99
98
|
query: {
|
|
100
99
|
roleId: record.id
|
|
101
100
|
}
|
|
@@ -103,17 +102,17 @@ var RoleList = function RoleList(props) {
|
|
|
103
102
|
};
|
|
104
103
|
var handleRemove = function handleRemove(record) {
|
|
105
104
|
Modal.confirm({
|
|
106
|
-
title:
|
|
107
|
-
content:
|
|
108
|
-
okText:
|
|
109
|
-
cancelText:
|
|
105
|
+
title: '警告',
|
|
106
|
+
content: '确定删除吗?',
|
|
107
|
+
okText: '确认',
|
|
108
|
+
cancelText: '取消',
|
|
110
109
|
onOk: function onOk() {
|
|
111
110
|
onSubmitRemove(record);
|
|
112
111
|
}
|
|
113
112
|
});
|
|
114
113
|
};
|
|
115
114
|
var onSubmitRemove = /*#__PURE__*/function () {
|
|
116
|
-
var
|
|
115
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
|
|
117
116
|
var res, flag;
|
|
118
117
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
119
118
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -138,23 +137,23 @@ var RoleList = function RoleList(props) {
|
|
|
138
137
|
}, _callee);
|
|
139
138
|
}));
|
|
140
139
|
return function onSubmitRemove(_x) {
|
|
141
|
-
return
|
|
140
|
+
return _ref2.apply(this, arguments);
|
|
142
141
|
};
|
|
143
142
|
}();
|
|
144
143
|
var handleModalVisible = function handleModalVisible(flag, record) {
|
|
145
144
|
var val = record === undefined ? {} : record;
|
|
146
|
-
var type = record === undefined ?
|
|
145
|
+
var type = record === undefined ? 'create' : 'update';
|
|
147
146
|
setItemValues(val);
|
|
148
147
|
setFormType(type);
|
|
149
148
|
toggleModalVisible(!!flag);
|
|
150
149
|
};
|
|
151
150
|
var handleCancel = function handleCancel() {
|
|
152
151
|
setItemValues({});
|
|
153
|
-
setFormType(
|
|
152
|
+
setFormType('');
|
|
154
153
|
toggleModalVisible(false);
|
|
155
154
|
};
|
|
156
155
|
var handleAdd = /*#__PURE__*/function () {
|
|
157
|
-
var
|
|
156
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(fields) {
|
|
158
157
|
var res, flag;
|
|
159
158
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
160
159
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -179,11 +178,11 @@ var RoleList = function RoleList(props) {
|
|
|
179
178
|
}, _callee2);
|
|
180
179
|
}));
|
|
181
180
|
return function handleAdd(_x2) {
|
|
182
|
-
return
|
|
181
|
+
return _ref3.apply(this, arguments);
|
|
183
182
|
};
|
|
184
183
|
}();
|
|
185
184
|
var handleUpdate = /*#__PURE__*/function () {
|
|
186
|
-
var
|
|
185
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(fields) {
|
|
187
186
|
var res, flag;
|
|
188
187
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
189
188
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -208,7 +207,7 @@ var RoleList = function RoleList(props) {
|
|
|
208
207
|
}, _callee3);
|
|
209
208
|
}));
|
|
210
209
|
return function handleUpdate(_x3) {
|
|
211
|
-
return
|
|
210
|
+
return _ref4.apply(this, arguments);
|
|
212
211
|
};
|
|
213
212
|
}();
|
|
214
213
|
var parentMethods = {
|
|
@@ -216,7 +215,7 @@ var RoleList = function RoleList(props) {
|
|
|
216
215
|
handleUpdate: handleUpdate,
|
|
217
216
|
onCancel: handleCancel
|
|
218
217
|
};
|
|
219
|
-
return /*#__PURE__*/React.createElement(
|
|
218
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
220
219
|
className: styles.tableList
|
|
221
220
|
}, /*#__PURE__*/React.createElement(ProTable, {
|
|
222
221
|
headerTitle: "\u89D2\u8272\u5217\u8868",
|
|
@@ -231,7 +230,7 @@ var RoleList = function RoleList(props) {
|
|
|
231
230
|
}, /*#__PURE__*/React.createElement(PlusOutlined, null), " \u65B0\u5EFA")];
|
|
232
231
|
},
|
|
233
232
|
request: ( /*#__PURE__*/function () {
|
|
234
|
-
var
|
|
233
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
|
|
235
234
|
var data;
|
|
236
235
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
237
236
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -254,7 +253,7 @@ var RoleList = function RoleList(props) {
|
|
|
254
253
|
}, _callee4);
|
|
255
254
|
}));
|
|
256
255
|
return function (_x4) {
|
|
257
|
-
return
|
|
256
|
+
return _ref5.apply(this, arguments);
|
|
258
257
|
};
|
|
259
258
|
}()),
|
|
260
259
|
pagination: {
|
|
@@ -266,9 +265,11 @@ var RoleList = function RoleList(props) {
|
|
|
266
265
|
modalVisible: modalVisible,
|
|
267
266
|
currentItem: itemValues,
|
|
268
267
|
formType: formType
|
|
269
|
-
})) : null)
|
|
268
|
+
})) : null);
|
|
270
269
|
};
|
|
271
|
-
export default
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
export default connect(function (_ref6) {
|
|
271
|
+
var user = _ref6.user;
|
|
272
|
+
return {
|
|
273
|
+
currentUser: user.currentUser
|
|
274
|
+
};
|
|
275
|
+
})(RoleList);
|
|
@@ -9,10 +9,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import { asyncCallback } from "../../../../utils/utils.js";
|
|
12
|
-
import ProTable from
|
|
13
|
-
;
|
|
14
|
-
import
|
|
15
|
-
import
|
|
12
|
+
import ProTable from '@ant-design/pro-table';
|
|
13
|
+
import { Divider, Form, Modal, Space } from 'antd';
|
|
14
|
+
import React, { useRef, useState } from 'react';
|
|
15
|
+
import { connect } from 'umi';
|
|
16
16
|
import { assignRole, changeAdmin, fetchUsers } from "../service.js";
|
|
17
17
|
import RoleUpdateForm from "./components/RoleUpdateForm";
|
|
18
18
|
var confirm = Modal.confirm;
|
|
@@ -35,66 +35,66 @@ var UserList = function UserList(props) {
|
|
|
35
35
|
var actionRef = useRef();
|
|
36
36
|
var currentUser = props.currentUser;
|
|
37
37
|
var columns = [{
|
|
38
|
-
title:
|
|
39
|
-
dataIndex:
|
|
38
|
+
title: '查询内容',
|
|
39
|
+
dataIndex: 'keyString',
|
|
40
40
|
hideInTable: true,
|
|
41
41
|
fieldProps: {
|
|
42
|
-
placeholder:
|
|
42
|
+
placeholder: '姓名、用户名、所属机构'
|
|
43
43
|
}
|
|
44
44
|
}, {
|
|
45
|
-
title:
|
|
46
|
-
dataIndex:
|
|
45
|
+
title: '姓名',
|
|
46
|
+
dataIndex: 'realName',
|
|
47
47
|
hideInSearch: true
|
|
48
48
|
}, {
|
|
49
|
-
title:
|
|
50
|
-
dataIndex:
|
|
49
|
+
title: '用户名',
|
|
50
|
+
dataIndex: 'userName',
|
|
51
51
|
hideInSearch: true
|
|
52
52
|
}, {
|
|
53
|
-
title:
|
|
54
|
-
dataIndex:
|
|
53
|
+
title: '角色',
|
|
54
|
+
dataIndex: 'roleName',
|
|
55
55
|
hideInSearch: true,
|
|
56
56
|
render: function render(text, record) {
|
|
57
57
|
var b = [];
|
|
58
58
|
record.roles.map(function (_) {
|
|
59
59
|
b.push(_.roleName);
|
|
60
60
|
});
|
|
61
|
-
return b.join(
|
|
61
|
+
return b.join(',');
|
|
62
62
|
}
|
|
63
63
|
}, {
|
|
64
|
-
title:
|
|
64
|
+
title: '所属机构',
|
|
65
65
|
hideInSearch: true,
|
|
66
|
-
dataIndex:
|
|
66
|
+
dataIndex: 'orgName'
|
|
67
67
|
}, {
|
|
68
|
-
title:
|
|
68
|
+
title: '操作',
|
|
69
69
|
hideInSearch: true,
|
|
70
70
|
render: function render(text, record) {
|
|
71
|
-
if (record.userType ==
|
|
71
|
+
if (record.userType == 'ADMIN') {
|
|
72
72
|
return /*#__PURE__*/React.createElement(Space, {
|
|
73
73
|
split: /*#__PURE__*/React.createElement(Divider, {
|
|
74
74
|
type: "vertical"
|
|
75
75
|
})
|
|
76
|
-
}, currentUser.userType ===
|
|
76
|
+
}, currentUser.userType === 'SUPERADMIN' && record.userTypeCode > currentUser.userTypeCode && /*#__PURE__*/React.createElement("a", {
|
|
77
77
|
onClick: function onClick() {
|
|
78
78
|
return handleModalVisible(true, record);
|
|
79
79
|
},
|
|
80
80
|
className: "textGreen"
|
|
81
|
-
}, "\u5206\u914D\u89D2\u8272"), currentUser.userType ===
|
|
81
|
+
}, "\u5206\u914D\u89D2\u8272"), currentUser.userType === 'SUPERADMIN' && /*#__PURE__*/React.createElement("a", {
|
|
82
82
|
onClick: function onClick() {
|
|
83
83
|
return handleAdminChange(record);
|
|
84
84
|
}
|
|
85
85
|
}, "\u53D6\u6D88\u7BA1\u7406\u5458"));
|
|
86
86
|
}
|
|
87
|
-
if (record.userType ==
|
|
87
|
+
if (record.userType == 'USER') {
|
|
88
88
|
return /*#__PURE__*/React.createElement(Space, {
|
|
89
89
|
split: /*#__PURE__*/React.createElement(Divider, {
|
|
90
90
|
type: "vertical"
|
|
91
91
|
})
|
|
92
|
-
}, currentUser.userType ===
|
|
92
|
+
}, currentUser.userType === 'SUPERADMIN' && record.userTypeCode > currentUser.userTypeCode && /*#__PURE__*/React.createElement("a", {
|
|
93
93
|
onClick: function onClick() {
|
|
94
94
|
return handleModalVisible(true, record);
|
|
95
95
|
},
|
|
96
96
|
className: "textGreen"
|
|
97
|
-
}, "\u5206\u914D\u89D2\u8272"), currentUser.userType ===
|
|
97
|
+
}, "\u5206\u914D\u89D2\u8272"), currentUser.userType === 'SUPERADMIN' && /*#__PURE__*/React.createElement("a", {
|
|
98
98
|
onClick: function onClick() {
|
|
99
99
|
return handleAdminChange(record);
|
|
100
100
|
}
|
|
@@ -108,10 +108,10 @@ var UserList = function UserList(props) {
|
|
|
108
108
|
};
|
|
109
109
|
var handleAdminChange = function handleAdminChange(record) {
|
|
110
110
|
confirm({
|
|
111
|
-
title:
|
|
112
|
-
content: record.userType ===
|
|
113
|
-
okText:
|
|
114
|
-
cancelText:
|
|
111
|
+
title: '警告',
|
|
112
|
+
content: record.userType === 'ADMIN' ? '确定取消管理员吗?' : '确定设置管理员吗?',
|
|
113
|
+
okText: '确认',
|
|
114
|
+
cancelText: '取消',
|
|
115
115
|
onOk: function onOk() {
|
|
116
116
|
changeRole(record);
|
|
117
117
|
},
|
|
@@ -188,7 +188,7 @@ var UserList = function UserList(props) {
|
|
|
188
188
|
form.resetFields();
|
|
189
189
|
actionRef.current.reload();
|
|
190
190
|
};
|
|
191
|
-
return /*#__PURE__*/React.createElement(
|
|
191
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProTable, {
|
|
192
192
|
headerTitle: "\u7528\u6237\u5217\u8868",
|
|
193
193
|
actionRef: actionRef,
|
|
194
194
|
rowKey: "id",
|
|
@@ -232,7 +232,9 @@ var UserList = function UserList(props) {
|
|
|
232
232
|
roles: roles
|
|
233
233
|
}));
|
|
234
234
|
};
|
|
235
|
-
export default
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
export default connect(function (_ref4) {
|
|
236
|
+
var user = _ref4.user;
|
|
237
|
+
return {
|
|
238
|
+
currentUser: user.currentUser
|
|
239
|
+
};
|
|
240
|
+
})(UserList);
|
|
@@ -27,7 +27,7 @@ var XyAuthLayout = function XyAuthLayout(props) {
|
|
|
27
27
|
var envData = getEnvData();
|
|
28
28
|
var service = propsService || getSessionStorage('service');
|
|
29
29
|
var token = getSessionStorage('Token');
|
|
30
|
-
var
|
|
30
|
+
var loginType = envData.login_type || 'BOTH';
|
|
31
31
|
var pathName = window.location.pathname;
|
|
32
32
|
|
|
33
33
|
// 通用请求头参数
|
|
@@ -56,7 +56,7 @@ var XyAuthLayout = function XyAuthLayout(props) {
|
|
|
56
56
|
useEffect(function () {
|
|
57
57
|
if (!token) {
|
|
58
58
|
// 当登录方式设为两端登录时,可在路径加上sso进行统一登陆,当登录方式固定为SSO时,直接跳转到SSO登录
|
|
59
|
-
if (
|
|
59
|
+
if (loginType === 'BOTH' && pathName.indexOf('/sso') >= 0 || loginType === 'SSO') {
|
|
60
60
|
setSessionStorage('sso_redirect_url', window.location.href);
|
|
61
61
|
envData.sso_type === 'new' ? ssoTypeByNew() : ssoTypeByOld();
|
|
62
62
|
} else {
|
|
@@ -70,8 +70,8 @@ var XyAuthLayout = function XyAuthLayout(props) {
|
|
|
70
70
|
|
|
71
71
|
// 处理 401 未授权错误(登录过期)
|
|
72
72
|
var handleUnauthorized = function handleUnauthorized() {
|
|
73
|
-
var actualLoginType =
|
|
74
|
-
if (
|
|
73
|
+
var actualLoginType = loginType;
|
|
74
|
+
if (loginType === 'BOTH') {
|
|
75
75
|
var redirectUrl = getSessionStorage('sso_redirect_url');
|
|
76
76
|
actualLoginType = redirectUrl ? 'SSO' : 'AAA';
|
|
77
77
|
}
|
|
@@ -92,68 +92,60 @@ var XyAuthLayout = function XyAuthLayout(props) {
|
|
|
92
92
|
};
|
|
93
93
|
var getUserinfo = /*#__PURE__*/function () {
|
|
94
94
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
95
|
-
var
|
|
95
|
+
var response;
|
|
96
96
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
97
97
|
while (1) switch (_context.prev = _context.next) {
|
|
98
98
|
case 0:
|
|
99
99
|
_context.prev = 0;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (propsLoginType === 'BOTH') {
|
|
103
|
-
redirectUrl = getSessionStorage('sso_redirect_url');
|
|
104
|
-
actualLoginType = redirectUrl ? 'SSO' : 'AAA';
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// 根据实际登录类型调用对应的接口
|
|
108
|
-
if (!(actualLoginType === 'SSO')) {
|
|
109
|
-
_context.next = 9;
|
|
100
|
+
if (!(loginType === 'SSO')) {
|
|
101
|
+
_context.next = 7;
|
|
110
102
|
break;
|
|
111
103
|
}
|
|
112
|
-
_context.next =
|
|
104
|
+
_context.next = 4;
|
|
113
105
|
return queryCurrent({});
|
|
114
|
-
case
|
|
106
|
+
case 4:
|
|
115
107
|
_context.t0 = _context.sent;
|
|
116
|
-
_context.next =
|
|
108
|
+
_context.next = 10;
|
|
117
109
|
break;
|
|
118
|
-
case
|
|
119
|
-
_context.next =
|
|
110
|
+
case 7:
|
|
111
|
+
_context.next = 9;
|
|
120
112
|
return queryAaaCurrent({});
|
|
121
|
-
case
|
|
113
|
+
case 9:
|
|
122
114
|
_context.t0 = _context.sent;
|
|
123
|
-
case
|
|
115
|
+
case 10:
|
|
124
116
|
response = _context.t0;
|
|
125
117
|
if (!((response === null || response === void 0 ? void 0 : response.status) === 401 || (response === null || response === void 0 ? void 0 : response.rspCode) === '401')) {
|
|
126
|
-
_context.next =
|
|
118
|
+
_context.next = 17;
|
|
127
119
|
break;
|
|
128
120
|
}
|
|
129
121
|
if (!getUserError) {
|
|
130
|
-
_context.next =
|
|
122
|
+
_context.next = 15;
|
|
131
123
|
break;
|
|
132
124
|
}
|
|
133
125
|
getUserError(response);
|
|
134
126
|
return _context.abrupt("return");
|
|
135
|
-
case
|
|
127
|
+
case 15:
|
|
136
128
|
// 否则自动处理登录过期
|
|
137
129
|
handleUnauthorized();
|
|
138
130
|
return _context.abrupt("return");
|
|
139
|
-
case
|
|
131
|
+
case 17:
|
|
140
132
|
if (response.rspCode === '000000') {
|
|
141
133
|
getUserOk && getUserOk(response.data);
|
|
142
134
|
} else {
|
|
143
135
|
getUserError && getUserError(response);
|
|
144
136
|
}
|
|
145
|
-
_context.next =
|
|
137
|
+
_context.next = 24;
|
|
146
138
|
break;
|
|
147
|
-
case
|
|
148
|
-
_context.prev =
|
|
139
|
+
case 20:
|
|
140
|
+
_context.prev = 20;
|
|
149
141
|
_context.t1 = _context["catch"](0);
|
|
150
142
|
console.error('获取用户信息失败:', _context.t1);
|
|
151
143
|
getUserError && getUserError(_context.t1);
|
|
152
|
-
case
|
|
144
|
+
case 24:
|
|
153
145
|
case "end":
|
|
154
146
|
return _context.stop();
|
|
155
147
|
}
|
|
156
|
-
}, _callee, null, [[0,
|
|
148
|
+
}, _callee, null, [[0, 20]]);
|
|
157
149
|
}));
|
|
158
150
|
return function getUserinfo() {
|
|
159
151
|
return _ref.apply(this, arguments);
|
|
@@ -327,11 +319,16 @@ export var logout = /*#__PURE__*/function () {
|
|
|
327
319
|
var loginType,
|
|
328
320
|
actualLoginType,
|
|
329
321
|
redirectUrl,
|
|
330
|
-
|
|
322
|
+
res,
|
|
323
|
+
removeSessionData,
|
|
331
324
|
_args5 = arguments;
|
|
332
325
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
333
326
|
while (1) switch (_context5.prev = _context5.next) {
|
|
334
327
|
case 0:
|
|
328
|
+
removeSessionData = function _removeSessionData() {
|
|
329
|
+
removeSessionStorage('Token');
|
|
330
|
+
removeSessionStorage('sso_redirect_url');
|
|
331
|
+
};
|
|
335
332
|
loginType = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 'BOTH';
|
|
336
333
|
// 当 loginType 为 BOTH 时,根据 sessionStorage 中的 'sso_redirect_url' 判断实际登录方式
|
|
337
334
|
// 有 'sso_redirect_url' 说明使用的是 SSO 登录,否则是 AAA 登录
|
|
@@ -340,48 +337,46 @@ export var logout = /*#__PURE__*/function () {
|
|
|
340
337
|
redirectUrl = getSessionStorage('sso_redirect_url');
|
|
341
338
|
actualLoginType = redirectUrl ? 'SSO' : 'AAA';
|
|
342
339
|
}
|
|
343
|
-
|
|
344
|
-
// 清理本地存储
|
|
345
|
-
removeSessionStorage('Token');
|
|
346
|
-
removeSessionStorage('sso_redirect_url');
|
|
347
340
|
if (!(actualLoginType === 'AAA')) {
|
|
348
341
|
_context5.next = 17;
|
|
349
342
|
break;
|
|
350
343
|
}
|
|
351
|
-
_context5.prev =
|
|
352
|
-
_context5.next =
|
|
344
|
+
_context5.prev = 5;
|
|
345
|
+
_context5.next = 8;
|
|
353
346
|
return accountAAALogout({});
|
|
354
|
-
case
|
|
347
|
+
case 8:
|
|
348
|
+
removeSessionData();
|
|
355
349
|
_context5.next = 14;
|
|
356
350
|
break;
|
|
357
351
|
case 11:
|
|
358
352
|
_context5.prev = 11;
|
|
359
|
-
_context5.t0 = _context5["catch"](
|
|
353
|
+
_context5.t0 = _context5["catch"](5);
|
|
360
354
|
console.error('AAA 退出登录失败:', _context5.t0);
|
|
361
355
|
case 14:
|
|
362
356
|
window.location.href = "".concat(window.publicPath || '/', "user/login");
|
|
363
|
-
_context5.next =
|
|
357
|
+
_context5.next = 28;
|
|
364
358
|
break;
|
|
365
359
|
case 17:
|
|
366
360
|
_context5.prev = 17;
|
|
367
361
|
_context5.next = 20;
|
|
368
362
|
return accountLogout({});
|
|
369
363
|
case 20:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
364
|
+
res = _context5.sent;
|
|
365
|
+
removeSessionData();
|
|
366
|
+
if (res) {
|
|
367
|
+
window.location.href = res;
|
|
373
368
|
}
|
|
374
|
-
_context5.next =
|
|
369
|
+
_context5.next = 28;
|
|
375
370
|
break;
|
|
376
|
-
case
|
|
377
|
-
_context5.prev =
|
|
371
|
+
case 25:
|
|
372
|
+
_context5.prev = 25;
|
|
378
373
|
_context5.t1 = _context5["catch"](17);
|
|
379
374
|
console.error('SSO 退出登录失败:', _context5.t1);
|
|
380
|
-
case
|
|
375
|
+
case 28:
|
|
381
376
|
case "end":
|
|
382
377
|
return _context5.stop();
|
|
383
378
|
}
|
|
384
|
-
}, _callee5, null, [[
|
|
379
|
+
}, _callee5, null, [[5, 11], [17, 25]]);
|
|
385
380
|
}));
|
|
386
381
|
return function logout() {
|
|
387
382
|
return _ref5.apply(this, arguments);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default Auth;
|
|
2
|
-
declare function Auth(props: any): JSX.Element;
|
|
2
|
+
declare function Auth(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UpdateForm;
|
|
2
|
-
declare function UpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function UpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default PermList;
|
|
2
|
-
declare function PermList(): JSX.Element;
|
|
2
|
+
declare function PermList(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UpdateForm;
|
|
2
|
-
declare function UpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function UpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default RequestUriList;
|
|
2
|
-
declare function RequestUriList(): JSX.Element;
|
|
2
|
+
declare function RequestUriList(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UpdateForm;
|
|
2
|
-
declare function UpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function UpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default RoleList;
|
|
2
|
-
declare function RoleList(): JSX.Element;
|
|
2
|
+
declare function RoleList(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UpdateForm;
|
|
2
|
-
declare function UpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function UpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UserList;
|
|
2
|
-
declare function UserList(props: any): JSX.Element;
|
|
2
|
+
declare function UserList(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default BothSecurityLayout;
|
|
2
|
-
declare function BothSecurityLayout(props: any): JSX.Element;
|
|
2
|
+
declare function BothSecurityLayout(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UpdateForm;
|
|
2
|
-
declare function UpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function UpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default DictionaryList;
|
|
2
|
-
declare function DictionaryList(): JSX.Element;
|
|
2
|
+
declare function DictionaryList(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default CreatePeopleForm;
|
|
2
|
-
declare function CreatePeopleForm(props: any): JSX.Element;
|
|
2
|
+
declare function CreatePeopleForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default CreateSubStoreForm;
|
|
2
|
-
declare function CreateSubStoreForm(props: any): JSX.Element;
|
|
2
|
+
declare function CreateSubStoreForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function _default(props: any): JSX.Element;
|
|
1
|
+
declare function _default(props: any): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default Organization;
|
|
2
|
-
declare function Organization(props: any): JSX.Element;
|
|
2
|
+
declare function Organization(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default SsoSecurityLayout;
|
|
2
|
-
declare function SsoSecurityLayout(props: any): JSX.Element;
|
|
2
|
+
declare function SsoSecurityLayout(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const _default: any;
|
|
2
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UpdateForm;
|
|
2
|
-
declare function UpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function UpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default PermList;
|
|
2
|
-
declare function PermList(): JSX.Element;
|
|
2
|
+
declare function PermList(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default UpdateForm;
|
|
2
|
-
declare function UpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function UpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const _default: any;
|
|
2
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default RoleUpdateForm;
|
|
2
|
-
declare function RoleUpdateForm(props: any): JSX.Element;
|
|
2
|
+
declare function RoleUpdateForm(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const _default: any;
|
|
2
|
+
export default _default;
|
|
@@ -50,7 +50,7 @@ declare function UploadFile(props: {
|
|
|
50
50
|
formItemOptions: FormItemProps;
|
|
51
51
|
uploadOptions: UploadProps;
|
|
52
52
|
buttonOptions: ButtonProps;
|
|
53
|
-
}): JSX.Element;
|
|
53
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
import { FormProps } from "antd";
|
|
55
55
|
import { FormItemProps } from "antd";
|
|
56
56
|
import { UploadProps } from "antd";
|
|
@@ -13,7 +13,7 @@ export function getQueryVariable(variable: string): string | boolean;
|
|
|
13
13
|
* @returns {Object} - 返回处理后的表格数据
|
|
14
14
|
*/
|
|
15
15
|
export function handleTableResponse(config: {
|
|
16
|
-
actionRef:
|
|
16
|
+
actionRef: import("react").MutableRefObject<any>;
|
|
17
17
|
res: any;
|
|
18
18
|
type?: string;
|
|
19
19
|
}): any;
|
package/dist/utils/request.js
CHANGED
|
@@ -7,11 +7,9 @@ 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, history } from 'umi';
|
|
11
11
|
import { message } from 'antd';
|
|
12
12
|
import { getSessionStorage } from "./token.js";
|
|
13
|
-
import { history } from 'umi';
|
|
14
|
-
var token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiZGFkYWJlOTAxMTA0MDc1YWZiNzU4ZWRhNTI4ZDc2NSIsImV4cCI6MTcxMzkzMzIzNywiaWF0IjoxNzEzOTI2MDM3fQ.fB4vs1wRvvbVth430mIPRIlhM8tXDvTCuvB339-E2fc';
|
|
15
13
|
export default function doRequest(_x, _x2, _x3, _x4) {
|
|
16
14
|
return _doRequest.apply(this, arguments);
|
|
17
15
|
}
|
|
@@ -23,7 +21,6 @@ function _doRequest() {
|
|
|
23
21
|
case 0:
|
|
24
22
|
headers = {
|
|
25
23
|
SID: SID,
|
|
26
|
-
// Authorization: 'Bearer ' + token,
|
|
27
24
|
Authorization: 'Bearer ' + getSessionStorage(),
|
|
28
25
|
UserId: getSessionStorage('userId'),
|
|
29
26
|
OrgId: getSessionStorage('orgId')
|
|
@@ -35,15 +32,14 @@ function _doRequest() {
|
|
|
35
32
|
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
36
33
|
service: getSessionStorage('service') || 'unknow'
|
|
37
34
|
}),
|
|
38
|
-
getResponse: true
|
|
35
|
+
getResponse: true,
|
|
36
|
+
skipErrorHandler: true
|
|
39
37
|
}).then(function (_ref) {
|
|
40
38
|
var data = _ref.data;
|
|
41
|
-
if (data.rspCode
|
|
42
|
-
return data;
|
|
43
|
-
} else {
|
|
39
|
+
if (data.rspCode !== '000000' && data.rspMsg) {
|
|
44
40
|
message.error(data.rspMsg);
|
|
45
|
-
return data;
|
|
46
41
|
}
|
|
42
|
+
return data;
|
|
47
43
|
}).catch( /*#__PURE__*/function () {
|
|
48
44
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(error) {
|
|
49
45
|
var _data;
|
|
@@ -58,7 +54,7 @@ function _doRequest() {
|
|
|
58
54
|
return error.response.json();
|
|
59
55
|
case 3:
|
|
60
56
|
_data = _context.sent;
|
|
61
|
-
message.error(_data.rspMsg);
|
|
57
|
+
_data.rspMsg && message.error(_data.rspMsg);
|
|
62
58
|
_context.next = 8;
|
|
63
59
|
break;
|
|
64
60
|
case 7:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xydata-tools",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "xydata tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -32,26 +32,32 @@
|
|
|
32
32
|
"antd": "^4.24.16",
|
|
33
33
|
"moment": "^2.30.1",
|
|
34
34
|
"react": "^17.0.0",
|
|
35
|
-
"react-dom": "^17.0.0"
|
|
35
|
+
"react-dom": "^17.0.0",
|
|
36
|
+
"umi": "^3.5.20"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
39
|
+
"@ant-design/icons": "^4.5.0",
|
|
40
|
+
"@ant-design/pro-form": "^1.69.4",
|
|
41
|
+
"@ant-design/pro-table": "^2.80.8",
|
|
38
42
|
"@babel/core": "7.24.9",
|
|
39
43
|
"@babel/preset-env": "7.24.8",
|
|
40
44
|
"@babel/preset-react": "7.24.7",
|
|
41
45
|
"@vitejs/plugin-vue2": "2.3.1",
|
|
46
|
+
"antd": "^4.24.16",
|
|
47
|
+
"cross-env": "^10.1.0",
|
|
42
48
|
"father": "4.1.5",
|
|
49
|
+
"moment": "^2.30.1",
|
|
50
|
+
"react": "^17.0.0",
|
|
51
|
+
"react-dom": "^17.0.0",
|
|
43
52
|
"terser": "5.31.3",
|
|
53
|
+
"umi": "^3.5.20",
|
|
44
54
|
"vue": "2.7.16",
|
|
45
55
|
"vue-loader": "15.11.1",
|
|
46
56
|
"vue-template-compiler": "2.7.16"
|
|
47
57
|
},
|
|
48
58
|
"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
59
|
"@zhengxs/js.tree": "0.5.0",
|
|
53
60
|
"compressorjs": "1.2.1",
|
|
54
|
-
"moment": "^2.30.1",
|
|
55
61
|
"querystring": "0.2.1",
|
|
56
62
|
"styled-components": "4.4.1"
|
|
57
63
|
}
|