fix: restful api bug

This commit is contained in:
sean 2017-08-29 13:38:42 +08:00
parent 6b9b1b9e0f
commit bbeff6bde5

View File

@ -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)
}