mirror of
https://github.com/YMFE/yapi.git
synced 2025-03-13 14:26:50 +08:00
fix: restful api bug
This commit is contained in:
parent
6b9b1b9e0f
commit
bbeff6bde5
@ -85,10 +85,8 @@ class InterfaceEditForm extends Component {
|
||||
handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
this.props.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
if (values.res_body_type === 'json') values.res_body = this.state.res_body;
|
||||
values.req_params = this.state.req_params;
|
||||
// values.req_body_other = this.state.req_body_other;
|
||||
if (!err) {
|
||||
if (values.res_body_type === 'json') values.res_body = this.state.res_body;
|
||||
values.method = this.state.method;
|
||||
let isfile = false, isHavaContentType = false;
|
||||
if (values.req_body_type === 'form') {
|
||||
@ -130,7 +128,7 @@ class InterfaceEditForm extends Component {
|
||||
values.req_query = values.req_query ? values.req_query.filter(item => item.name !== '') : []
|
||||
|
||||
if (HTTP_METHOD[values.method].request_body !== true) {
|
||||
values.req_params = []
|
||||
values.req_body_form = []
|
||||
}
|
||||
this.props.onSubmit(values)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user