@jiangood/springboot-admin-starter 0.0.1
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/config/config.js +10 -0
- package/config/config.local.js +10 -0
- package/config/defaultConfig.js +35 -0
- package/config/plugins/forms.js +44 -0
- package/config/plugins/routes.js +82 -0
- package/package.json +41 -0
- package/src/.npmignore +6 -0
- package/src/app.js +0 -0
- package/src/asserts/login_bg.jpg +0 -0
- package/src/asserts/welcome.png +0 -0
- package/src/components/InstanceInfo.jsx +138 -0
- package/src/components/InstanceStatusInfo.jsx +79 -0
- package/src/components/StreamLog.jsx +27 -0
- package/src/components/flow/BpmnUtils.js +85 -0
- package/src/components/flow/customTranslate/customTranslate.js +19 -0
- package/src/components/flow/customTranslate/translations.js +79 -0
- package/src/components/flow/design/contextPad.js +50 -0
- package/src/components/flow/design/form/ConditionForm.jsx +316 -0
- package/src/components/flow/design/form/ServiceTaskForm.jsx +55 -0
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +62 -0
- package/src/components/flow/design/form/UserTaskForm.jsx +211 -0
- package/src/components/flow/design/palette.js +39 -0
- package/src/components/monitor/AllDefinition.jsx +46 -0
- package/src/components/monitor/AllInstance.jsx +76 -0
- package/src/forms/demoForm.jsx +16 -0
- package/src/framework/components/ButtonList.d.ts +9 -0
- package/src/framework/components/ButtonList.jsx +91 -0
- package/src/framework/components/DownloadFileButton.d.ts +11 -0
- package/src/framework/components/DownloadFileButton.jsx +33 -0
- package/src/framework/components/Echarts/index.d.ts +10 -0
- package/src/framework/components/Echarts/index.jsx +49 -0
- package/src/framework/components/EditTable/index.d.ts +11 -0
- package/src/framework/components/EditTable/index.jsx +85 -0
- package/src/framework/components/EditTable/index.less +29 -0
- package/src/framework/components/Ellipsis.jsx +39 -0
- package/src/framework/components/Ellipsis.less +8 -0
- package/src/framework/components/FieldRemoteTree.jsx +20 -0
- package/src/framework/components/Gap/index.d.ts +10 -0
- package/src/framework/components/Gap/index.jsx +15 -0
- package/src/framework/components/Gap/index.less +3 -0
- package/src/framework/components/HasPerm.jsx +18 -0
- package/src/framework/components/ImageView.d.ts +12 -0
- package/src/framework/components/ImageView.jsx +64 -0
- package/src/framework/components/LinkButton.d.ts +14 -0
- package/src/framework/components/LinkButton.jsx +13 -0
- package/src/framework/components/MsgBox.jsx +180 -0
- package/src/framework/components/NamedIcon.tsx +15 -0
- package/src/framework/components/OrgTree.jsx +60 -0
- package/src/framework/components/Page/index.d.ts +10 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading.jsx +31 -0
- package/src/framework/components/Panel/index.d.ts +11 -0
- package/src/framework/components/Panel/index.jsx +24 -0
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +124 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +38 -0
- package/src/framework/components/ProTable/index.jsx +258 -0
- package/src/framework/components/ProTable/index.less +3 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree.jsx +53 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +38 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +46 -0
- package/src/framework/components/field/FieldBoolean/index.tsx +92 -0
- package/src/framework/components/field/FieldEditTable/index.d.ts +13 -0
- package/src/framework/components/field/FieldEditTable/index.jsx +103 -0
- package/src/framework/components/field/FieldEditTable/index.less +29 -0
- package/src/framework/components/field/FieldEditor.jsx +48 -0
- package/src/framework/components/field/FieldFileBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldFileBase64/index.jsx +23 -0
- package/src/framework/components/field/FieldImageBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldImageBase64/index.jsx +22 -0
- package/src/framework/components/field/FieldInput.jsx +13 -0
- package/src/framework/components/field/FieldOrgTree/index.tsx +45 -0
- package/src/framework/components/field/FieldPassword.jsx +11 -0
- package/src/framework/components/field/FieldProps.ts +19 -0
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +75 -0
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +81 -0
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +100 -0
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +82 -0
- package/src/framework/components/field/FieldSelectPosition/index.tsx +85 -0
- package/src/framework/components/field/FieldTree.jsx +45 -0
- package/src/framework/components/field/dict/index.tsx +110 -0
- package/src/framework/components/field/flat-multiple-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-multiple-select/index.jsx +116 -0
- package/src/framework/components/field/flat-multiple-select/index.less +12 -0
- package/src/framework/components/field/flat-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-select/index.jsx +107 -0
- package/src/framework/components/field/flat-select/index.less +12 -0
- package/src/framework/components/field/index.js +33 -0
- package/src/framework/components/field/input-number-percent/index.d.ts +11 -0
- package/src/framework/components/field/input-number-percent/index.jsx +28 -0
- package/src/framework/components/field/select/FieldSelect/index.d.ts +39 -0
- package/src/framework/components/field/select/FieldSelect/index.jsx +156 -0
- package/src/framework/components/field/select/FieldTableSelect/index.d.ts +29 -0
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +155 -0
- package/src/framework/components/field/select/index.jsx +2 -0
- package/src/framework/components/field/switch-y-n/index.d.ts +11 -0
- package/src/framework/components/field/switch-y-n/index.jsx +31 -0
- package/src/framework/components/field/text/index.tsx +7 -0
- package/src/framework/components/field/time/DatePickerString.tsx +37 -0
- package/src/framework/components/field/time/DateTimePickerString.tsx +42 -0
- package/src/framework/components/field/time/FieldDateRange.d.ts +9 -0
- package/src/framework/components/field/time/FieldDateRange.jsx +49 -0
- package/src/framework/components/field/time/HHmmPickerString.tsx +42 -0
- package/src/framework/components/field/time/MonthPickerString.tsx +45 -0
- package/src/framework/components/field/time/TimePickerTool.ts +14 -0
- package/src/framework/components/field/time/YearPickerString.tsx +41 -0
- package/src/framework/components/field/time/YearQuarterString.tsx +38 -0
- package/src/framework/components/field/time/index.tsx +7 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +22 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +11 -0
- package/src/framework/components/field/upload/FieldUploadFile.d.ts +35 -0
- package/src/framework/components/field/upload/FieldUploadFile.jsx +145 -0
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +7 -0
- package/src/framework/components/field/upload/FieldUploadImage.jsx +16 -0
- package/src/framework/components/field/upload/index.jsx +3 -0
- package/src/framework/components/index.js +25 -0
- package/src/framework/components/system.jsx +29 -0
- package/src/framework/components/view/ViewBoolean.jsx +15 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +16 -0
- package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
- package/src/framework/components/view/ViewEllipsis.jsx +30 -0
- package/src/framework/components/view/ViewFile.d.ts +10 -0
- package/src/framework/components/view/ViewFile.jsx +50 -0
- package/src/framework/components/view/ViewFileButton.d.ts +10 -0
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +9 -0
- package/src/framework/components/view/ViewImage.jsx +61 -0
- package/src/framework/components/view/ViewPassword.jsx +24 -0
- package/src/framework/components/view/ViewRange/index.d.ts +16 -0
- package/src/framework/components/view/ViewRange/index.jsx +20 -0
- package/src/framework/components/view/ViewText.jsx +9 -0
- package/src/framework/components/view/index.js +12 -0
- package/src/framework/index.js +3 -0
- package/src/framework/system/FormRegistry.js +58 -0
- package/src/framework/system/dict.js +88 -0
- package/src/framework/system/http.jsx +290 -0
- package/src/framework/system/index.js +13 -0
- package/src/framework/system/page.js +109 -0
- package/src/framework/system/permission.js +44 -0
- package/src/framework/system/sys.js +60 -0
- package/src/framework/system/theme.js +17 -0
- package/src/framework/utils/arr.js +118 -0
- package/src/framework/utils/browser.js +24 -0
- package/src/framework/utils/color.js +269 -0
- package/src/framework/utils/date.js +173 -0
- package/src/framework/utils/debounce.js +33 -0
- package/src/framework/utils/dom.js +16 -0
- package/src/framework/utils/eventBus.js +70 -0
- package/src/framework/utils/html.js +13 -0
- package/src/framework/utils/index.js +17 -0
- package/src/framework/utils/obj.js +72 -0
- package/src/framework/utils/storage.js +37 -0
- package/src/framework/utils/str.js +297 -0
- package/src/framework/utils/tree.js +175 -0
- package/src/framework/utils/uid.js +76 -0
- package/src/framework/utils/url.js +84 -0
- package/src/framework/utils/validate.js +9 -0
- package/src/index.js +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +174 -0
- package/src/layouts/admin/index.less +64 -0
- package/src/layouts/index.jsx +163 -0
- package/src/layouts/index.less +45 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +14 -0
- package/src/pages/api/accessLog/index.jsx +108 -0
- package/src/pages/api/accountResource/index.jsx +149 -0
- package/src/pages/api/doc.jsx +135 -0
- package/src/pages/api/index.jsx +163 -0
- package/src/pages/api/resource.jsx +18 -0
- package/src/pages/flowable/design/index.css +7 -0
- package/src/pages/flowable/design/index.jsx +297 -0
- package/src/pages/flowable/index.jsx +128 -0
- package/src/pages/flowable/instance/view.jsx +13 -0
- package/src/pages/flowable/monitor.jsx +106 -0
- package/src/pages/flowable/task/form.jsx +99 -0
- package/src/pages/flowable/task/index.jsx +200 -0
- package/src/pages/flowable/test/form.jsx +31 -0
- package/src/pages/flowable/test/index.jsx +54 -0
- package/src/pages/index.jsx +25 -0
- package/src/pages/job/index.jsx +239 -0
- package/src/pages/job/logList.jsx +100 -0
- package/src/pages/job/status.jsx +84 -0
- package/src/pages/login.jsx +144 -0
- package/src/pages/login.less +53 -0
- package/src/pages/system/config/index.jsx +136 -0
- package/src/pages/system/dict/Dict.jsx +73 -0
- package/src/pages/system/dict/DictItem.jsx +177 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +152 -0
- package/src/pages/system/log/index.jsx +78 -0
- package/src/pages/system/org/index.jsx +263 -0
- package/src/pages/system/role/index.jsx +314 -0
- package/src/pages/system/role/perm.jsx +111 -0
- package/src/pages/system/sysManual/index.jsx +127 -0
- package/src/pages/system/user/UserPerm.jsx +132 -0
- package/src/pages/system/user/index.jsx +261 -0
- package/src/pages/test.jsx +16 -0
- package/src/pages/ureport/index.jsx +43 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +63 -0
- package/src/pages/userCenter/message.jsx +105 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {PlusOutlined} from '@ant-design/icons'
|
|
2
|
+
import {Button, Form, Modal, Popconfirm} from 'antd'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import {
|
|
5
|
+
ButtonList,
|
|
6
|
+
FieldRadioBoolean,
|
|
7
|
+
FieldTableSelect,
|
|
8
|
+
HttpUtil,
|
|
9
|
+
Page,
|
|
10
|
+
PageUtil,
|
|
11
|
+
ProTable,
|
|
12
|
+
ViewBoolean
|
|
13
|
+
} from "../../../framework";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export default class extends React.Component {
|
|
17
|
+
|
|
18
|
+
state = {
|
|
19
|
+
formValues: {},
|
|
20
|
+
formOpen: false
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
formRef = React.createRef()
|
|
24
|
+
tableRef = React.createRef()
|
|
25
|
+
|
|
26
|
+
constructor(props) {
|
|
27
|
+
super(props);
|
|
28
|
+
this.accountId = PageUtil.currentParams().accountId
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
columns = [
|
|
32
|
+
|
|
33
|
+
{
|
|
34
|
+
title: '账户',
|
|
35
|
+
dataIndex: ['account', 'name'],
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
title: '接口名称',
|
|
41
|
+
dataIndex: ['resource', 'name'],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: '接口动作',
|
|
45
|
+
dataIndex: ['resource', 'action'],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: '描述',
|
|
49
|
+
dataIndex: ['resource', 'desc'],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: '启用',
|
|
53
|
+
dataIndex: 'enable',
|
|
54
|
+
render(v) {
|
|
55
|
+
return <ViewBoolean value={v}/>
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
{
|
|
60
|
+
title: '操作',
|
|
61
|
+
dataIndex: 'option',
|
|
62
|
+
render: (_, record) => (
|
|
63
|
+
<ButtonList>
|
|
64
|
+
<Button size='small' perm='apiAccountResource:save'
|
|
65
|
+
onClick={() => this.handleEdit(record)}>编辑</Button>
|
|
66
|
+
<Popconfirm perm='apiAccountResource:delete' title='是否确定删除访客权限'
|
|
67
|
+
onConfirm={() => this.handleDelete(record)}>
|
|
68
|
+
<Button size='small'>删除</Button>
|
|
69
|
+
</Popconfirm>
|
|
70
|
+
</ButtonList>
|
|
71
|
+
),
|
|
72
|
+
},
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
handleAdd = () => {
|
|
76
|
+
this.setState({formOpen: true, formValues: {}})
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
handleEdit = record => {
|
|
80
|
+
this.setState({formOpen: true, formValues: record})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
onFinish = values => {
|
|
85
|
+
values.account = {id: this.accountId}
|
|
86
|
+
HttpUtil.post('admin/apiAccountResource/save', values).then(rs => {
|
|
87
|
+
this.setState({formOpen: false})
|
|
88
|
+
this.tableRef.current.reload()
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
handleDelete = record => {
|
|
94
|
+
HttpUtil.get('admin/apiAccountResource/delete', {id: record.id}).then(rs => {
|
|
95
|
+
this.tableRef.current.reload()
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
render() {
|
|
100
|
+
return <Page>
|
|
101
|
+
|
|
102
|
+
<ProTable
|
|
103
|
+
actionRef={this.tableRef}
|
|
104
|
+
toolBarRender={() => {
|
|
105
|
+
return <ButtonList>
|
|
106
|
+
<Button perm='apiAccountResource:save' type='primary' onClick={this.handleAdd}>
|
|
107
|
+
<PlusOutlined/> 新增
|
|
108
|
+
</Button>
|
|
109
|
+
</ButtonList>
|
|
110
|
+
}}
|
|
111
|
+
request={(params) => {
|
|
112
|
+
params.accountId =PageUtil.currentParams().accountId
|
|
113
|
+
return HttpUtil.pageData('admin/apiAccountResource/page', params);
|
|
114
|
+
}}
|
|
115
|
+
columns={this.columns}
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
<Modal title='账号权限'
|
|
119
|
+
open={this.state.formOpen}
|
|
120
|
+
onOk={() => this.formRef.current.submit()}
|
|
121
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
122
|
+
destroyOnHidden
|
|
123
|
+
maskClosable={false}
|
|
124
|
+
>
|
|
125
|
+
|
|
126
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
127
|
+
initialValues={this.state.formValues}
|
|
128
|
+
onFinish={this.onFinish}
|
|
129
|
+
>
|
|
130
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
131
|
+
|
|
132
|
+
<Form.Item label='接口' name={['resource', 'id']} rules={[{required: true}]}>
|
|
133
|
+
<FieldTableSelect url='admin/apiResource/tableSelect' labelKey='name'/>
|
|
134
|
+
</Form.Item>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<Form.Item label='启用' name='enable' rules={[{required: true}]}>
|
|
138
|
+
<FieldRadioBoolean/>
|
|
139
|
+
</Form.Item>
|
|
140
|
+
|
|
141
|
+
</Form>
|
|
142
|
+
</Modal>
|
|
143
|
+
</Page>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {HttpUtil, PageUtil} from "../../framework";
|
|
3
|
+
import {Button, Descriptions, Table, Typography} from "antd";
|
|
4
|
+
|
|
5
|
+
const {Title, Paragraph, Text, Link} = Typography;
|
|
6
|
+
|
|
7
|
+
export default class extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
url: null,
|
|
11
|
+
appId: null,
|
|
12
|
+
apiList: [],
|
|
13
|
+
frameworkVersion: null,
|
|
14
|
+
errorList:[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
columns = [
|
|
18
|
+
{dataIndex: 'name', title: '名称', width: 150},
|
|
19
|
+
{dataIndex: 'type', title: '类型', width: 100},
|
|
20
|
+
{
|
|
21
|
+
dataIndex: 'required', title: '必填', width: 100, render: v => {
|
|
22
|
+
if (v == null) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return v ? '是' : '否';
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{dataIndex: 'desc', title: '描述'},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
componentDidMount() {
|
|
32
|
+
const id = PageUtil.currentParams().id
|
|
33
|
+
|
|
34
|
+
HttpUtil.get('admin/apiAccount/docInfo', {id}).then(rs => {
|
|
35
|
+
this.setState(rs)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
let url = window.location.protocol + '//' + window.location.host
|
|
39
|
+
this.setState({url})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
print() {
|
|
43
|
+
window.print();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
render() {
|
|
47
|
+
const {apiList} = this.state
|
|
48
|
+
return <div style={{padding: 24}}>
|
|
49
|
+
<Button type='primary' onClick={this.print} className='no-print'>打印文档</Button>
|
|
50
|
+
<div id='doc-content'>
|
|
51
|
+
<Title level={1}>开发接口说明文档</Title>
|
|
52
|
+
|
|
53
|
+
<Title level={2}>接口数据</Title>
|
|
54
|
+
<Paragraph>
|
|
55
|
+
<Descriptions column={1} bordered size='small'>
|
|
56
|
+
<Descriptions.Item label='请求地址'>
|
|
57
|
+
{this.state.url}/api/gateway/路径
|
|
58
|
+
</Descriptions.Item>
|
|
59
|
+
<Descriptions.Item label='appId'>
|
|
60
|
+
{this.state.appId}
|
|
61
|
+
</Descriptions.Item>
|
|
62
|
+
<Descriptions.Item label='appSecret'>
|
|
63
|
+
****** (私发给相应)
|
|
64
|
+
</Descriptions.Item>
|
|
65
|
+
</Descriptions>
|
|
66
|
+
|
|
67
|
+
</Paragraph>
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<Title level={2}>1 接口说明</Title>
|
|
71
|
+
<Paragraph>
|
|
72
|
+
<Typography.Text>
|
|
73
|
+
<div>
|
|
74
|
+
请求使用HTTP POST发送,请求参数也使用json格式
|
|
75
|
+
</div>
|
|
76
|
+
<div> 响应报文以JSON方式返回</div>
|
|
77
|
+
</Typography.Text>
|
|
78
|
+
</Paragraph>
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<Title level={4}>请求公共请求头说明</Title>
|
|
82
|
+
|
|
83
|
+
<Table columns={this.columns} bordered dataSource={[
|
|
84
|
+
{name: 'appId', type: 'String', required: true, desc: '账号标识,appId'},
|
|
85
|
+
{name: 'timestamp', type: 'String', required: true, desc: '时间戳,当前UNIX时间戳,13位,精确到毫秒'},
|
|
86
|
+
{name: 'sign', type: 'String', required: true, desc: '数据签名,appId + appSecret + timestamp拼接后,进行md5摘要,值为32位小写'},
|
|
87
|
+
]} size='small' pagination={false}>
|
|
88
|
+
</Table>
|
|
89
|
+
|
|
90
|
+
<Title level={4}>返回公共参数说明 </Title>
|
|
91
|
+
<Table columns={this.columns} bordered dataSource={[
|
|
92
|
+
{name: 'code', type: 'int', required: true, desc: '返回码,成功返回0,其他表示操作错误'},
|
|
93
|
+
{name: 'message', type: 'String', required: false, desc: '结果提示信息'},
|
|
94
|
+
{name: 'data', type: 'String', required: false, desc: '返回数据JSON'}
|
|
95
|
+
]} size='small' pagination={false}>
|
|
96
|
+
</Table>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<Typography.Title level={2}>2 接口列表</Typography.Title>
|
|
101
|
+
{apiList.map((api, index) => {
|
|
102
|
+
return <>
|
|
103
|
+
<Typography.Title level={3}>{'2.' + (index + 1) + " " + api.name} </Typography.Title>
|
|
104
|
+
<p>功能描述:{api.desc}</p>
|
|
105
|
+
<p>请求路径: /api/gateway/{api.action}</p>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<Title level={5}>请求参数说明</Title>
|
|
109
|
+
<Table columns={this.columns} bordered dataSource={api.parameterList}
|
|
110
|
+
size='small' pagination={false}>
|
|
111
|
+
</Table>
|
|
112
|
+
|
|
113
|
+
<Title level={5}>返回参数说明</Title>
|
|
114
|
+
<Typography.Text>
|
|
115
|
+
返回对象:{api.returnType}
|
|
116
|
+
</Typography.Text>
|
|
117
|
+
|
|
118
|
+
{api.returnList != null && api.returnList.length > 0 &&
|
|
119
|
+
<Table columns={this.columns} bordered
|
|
120
|
+
dataSource={api.returnList} size='small' pagination={false}>
|
|
121
|
+
</Table>}
|
|
122
|
+
|
|
123
|
+
</>
|
|
124
|
+
})}
|
|
125
|
+
|
|
126
|
+
<Typography.Title level={2}>3 公共错误码</Typography.Title>
|
|
127
|
+
<Table columns={[
|
|
128
|
+
{dataIndex:'code',title:'错误码'},
|
|
129
|
+
{dataIndex:'message', title:'错误描述'}
|
|
130
|
+
]} rowKey='code' bordered dataSource={this.state.errorList} size='small' pagination={false}>
|
|
131
|
+
</Table>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {PlusOutlined} from '@ant-design/icons'
|
|
2
|
+
import {Button, Form, Input, Modal, Popconfirm} from 'antd'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import {
|
|
5
|
+
ButtonList,
|
|
6
|
+
FieldDateTimePickerString,
|
|
7
|
+
FieldRadioBoolean,
|
|
8
|
+
HttpUtil,
|
|
9
|
+
PageUtil,
|
|
10
|
+
ProTable,
|
|
11
|
+
StrUtil
|
|
12
|
+
} from "../../framework";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export default class extends React.Component {
|
|
16
|
+
|
|
17
|
+
state = {
|
|
18
|
+
formValues: {},
|
|
19
|
+
formOpen: false
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
formRef = React.createRef()
|
|
23
|
+
tableRef = React.createRef()
|
|
24
|
+
|
|
25
|
+
columns = [
|
|
26
|
+
{
|
|
27
|
+
title: '名称',
|
|
28
|
+
dataIndex: 'name',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'appId',
|
|
32
|
+
dataIndex: 'appId',
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
title: 'appSecret',
|
|
37
|
+
dataIndex: 'appSecret',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: '准入IP',
|
|
41
|
+
dataIndex: 'accessIp',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: '有效期',
|
|
45
|
+
dataIndex: 'endTime',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: '启用',
|
|
49
|
+
dataIndex: 'enable',
|
|
50
|
+
render(v){
|
|
51
|
+
return v == null ? null : ( v ? '是': '否')
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: '操作',
|
|
56
|
+
dataIndex: 'option',
|
|
57
|
+
render: (_, record) => (
|
|
58
|
+
<ButtonList>
|
|
59
|
+
<Button size='small' onClick={()=>PageUtil.open('/api/accountResource?accountId=' + record.id, '账户权限')} type='primary'>权限</Button>
|
|
60
|
+
<Button size='small' onClick={()=>this.handleDoc(record)}>文档</Button>
|
|
61
|
+
<Button size='small' perm='apiAccount:save' onClick={() => this.handleEdit(record)}>编辑</Button>
|
|
62
|
+
<Popconfirm perm='apiAccount:delete' title='是否确定删除接口访客' onConfirm={() => this.handleDelete(record)}>
|
|
63
|
+
<Button size='small'>删除</Button>
|
|
64
|
+
</Popconfirm>
|
|
65
|
+
</ButtonList>
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
handleAdd = ()=>{
|
|
71
|
+
this.setState({formOpen: true, formValues: {}})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
handleEdit = record=>{
|
|
75
|
+
this.setState({formOpen: true, formValues: record})
|
|
76
|
+
}
|
|
77
|
+
handleDoc = record=>{
|
|
78
|
+
PageUtil.openNoLayout('/api/doc?id='+record.id)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
onFinish = values => {
|
|
83
|
+
HttpUtil.post( 'admin/apiAccount/save', values).then(rs => {
|
|
84
|
+
this.setState({formOpen: false})
|
|
85
|
+
this.tableRef.current.reload()
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
handleDelete = record => {
|
|
92
|
+
HttpUtil.get( 'admin/apiAccount/delete', {id:record.id}).then(rs => {
|
|
93
|
+
this.tableRef.current.reload()
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
randomAppSecret = ()=>{
|
|
98
|
+
const appSecret = StrUtil.random(32)
|
|
99
|
+
this.formRef.current.setFieldsValue({appSecret})
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
render() {
|
|
103
|
+
return <>
|
|
104
|
+
<ProTable
|
|
105
|
+
actionRef={this.tableRef}
|
|
106
|
+
toolBarRender={() => {
|
|
107
|
+
return <ButtonList>
|
|
108
|
+
<Button perm='apiAccount:save' type='primary' onClick={this.handleAdd}>
|
|
109
|
+
<PlusOutlined/> 新增
|
|
110
|
+
</Button>
|
|
111
|
+
</ButtonList>
|
|
112
|
+
}}
|
|
113
|
+
request={(params) => HttpUtil.pageData('admin/apiAccount/page', params)}
|
|
114
|
+
columns={this.columns}
|
|
115
|
+
/>
|
|
116
|
+
|
|
117
|
+
<Modal title='接口访客'
|
|
118
|
+
open={this.state.formOpen}
|
|
119
|
+
onOk={() => this.formRef.current.submit()}
|
|
120
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
121
|
+
destroyOnHidden
|
|
122
|
+
maskClosable={false}
|
|
123
|
+
>
|
|
124
|
+
|
|
125
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
126
|
+
initialValues={this.state.formValues}
|
|
127
|
+
onFinish={this.onFinish}
|
|
128
|
+
|
|
129
|
+
>
|
|
130
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
131
|
+
|
|
132
|
+
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
133
|
+
<Input/>
|
|
134
|
+
</Form.Item>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<Form.Item label='appId' name='appId' >
|
|
138
|
+
<Input placeholder='多个用逗号分隔'/>
|
|
139
|
+
</Form.Item>
|
|
140
|
+
<Form.Item label='appSecret' name='appSecret' rules={[{required: true},{len:32}]}
|
|
141
|
+
help={<Button size='small' type='link' onClick={this.randomAppSecret}>随机生成</Button>}
|
|
142
|
+
>
|
|
143
|
+
<Input />
|
|
144
|
+
</Form.Item>
|
|
145
|
+
|
|
146
|
+
<Form.Item label='准入IP' name='accessIp' >
|
|
147
|
+
<Input placeholder='多个用逗号分隔'/>
|
|
148
|
+
</Form.Item>
|
|
149
|
+
<Form.Item label='有效期' name='endTime' style={{marginTop:32}}>
|
|
150
|
+
<FieldDateTimePickerString />
|
|
151
|
+
</Form.Item>
|
|
152
|
+
<Form.Item label='启用' name='enable' rules={[{required: true}]}>
|
|
153
|
+
<FieldRadioBoolean />
|
|
154
|
+
</Form.Item>
|
|
155
|
+
|
|
156
|
+
</Form>
|
|
157
|
+
</Modal>
|
|
158
|
+
</>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {HttpUtil, ProTable} from "../../framework";
|
|
3
|
+
|
|
4
|
+
export default class extends React.Component {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
render() {
|
|
8
|
+
return <ProTable
|
|
9
|
+
columns={[
|
|
10
|
+
{dataIndex: 'name', title: '名称'},
|
|
11
|
+
{dataIndex: 'action', title: '动作'},
|
|
12
|
+
{dataIndex: 'desc', title: '描述'},
|
|
13
|
+
|
|
14
|
+
]}
|
|
15
|
+
request={(params,) => HttpUtil.pageData('admin/apiResource/page', params)}
|
|
16
|
+
/>
|
|
17
|
+
}
|
|
18
|
+
}
|