From 93a6f8b073785472e533f09da300595b51fc17be Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 29 Sep 2022 10:26:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5=E7=9A=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=97=A0=E6=B3=95=E6=B7=BB=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017203 --user=王孝刚 【接口测试】导入的接口,上传文件/关联系统文件没有反应 https://www.tapd.cn/55049933/s/1254069 --- .../definition/components/EditCompleteContainer.vue | 6 ------ .../api/definition/components/list/ApiList.vue | 12 +++++++++++- 2 files changed, 11 insertions(+), 7 deletions(-) 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 = []; }