diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue index a7cf52e3ac..8c73801f48 100644 --- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue +++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue @@ -141,7 +141,6 @@ import ApiCaseSimpleList from "./list/ApiCaseSimpleList"; import MsApiCaseList from "./case/ApiCaseList"; import {getUUID} from "@/common/js/utils"; import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting"; -import _ from 'lodash'; import MsContainer from "@/business/components/common/components/MsContainer"; import MsAsideContainer from "@/business/components/common/components/MsAsideContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer"; @@ -272,11 +271,6 @@ export default { if (this.currentApi.request != null && this.currentApi.request != 'null' && this.currentApi.request != undefined) { if (Object.prototype.toString.call(this.currentApi.request).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') { this.currentApi.request = JSON.parse(this.currentApi.request); - if (this.currentApi.request.body && !this.currentApi.request.body.type) { - let tempRequest = _.cloneDeep(this.currentApi.request); - tempRequest.body = {type: null}; - this.currentApi.request = tempRequest; - } } } if (this.currentApi && this.currentApi.request && !this.currentApi.request.hashTree) { diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index e4fe510404..9012284085 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -194,7 +194,6 @@ prop="description" :field="item" min-width="120px" - sortable :fields-width="fieldsWidth" :label="$t('commons.description')"/> @@ -704,9 +703,20 @@ export default { if (!item.request.body) { item.request.body = new Body(); } + if (!item.request.body.type) { + this.$set(item.request.body, "type", null); + } if (!item.request.headers) { item.request.headers = []; } + if (!item.request.body.kvs) { + item.request.body.kvs = []; + } + item.request.body.kvs.forEach(i => { + if (!i.files) { + i.files = [] + } + }) if (!item.request.rest) { item.request.rest = []; }