From 684a432e617b42fd47cead4589c92f2e3dd3e17b Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 8 Dec 2022 14:01:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E9=99=84=E4=BB=B6tab?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=90=8E=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020743 --user=赵勇 【接口测试】GET接口请求体中上传文件后改成POST接口执行,提示找不到文件 https://www.tapd.cn/55049933/s/1314213 --- .../components/runtest/RunTestHTTPPage.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue index e7c1a3314b..05c5d9fb8a 100644 --- a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue +++ b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue @@ -453,13 +453,24 @@ export default { this.runLoading = false; this.checkVersionEnable(); }, + margeFiles(targetFiles, sourceFiles) { + targetFiles.forEach((target) => { + sourceFiles.forEach((source) => { + if (target.uuid === source.uuid) { + source.file = target.file; + } + }); + }); + }, initLocalFile() { if (this.apiData.request && this.apiData.request.body) { if (this.apiData.request.body.binary && this.apiData.request.body.binary.length > 0) { this.apiData.request.body.binary.forEach((item) => { this.api.request.body.binary.forEach((api) => { if (item.uuid && api.uuid && item.uuid === api.uuid) { - api = item; + api.files = item.files; + } else if (item.files && api.files) { + this.margeFiles(item.files, api.files); } }); }); @@ -469,6 +480,8 @@ export default { this.api.request.body.kvs.forEach((api) => { if (item.uuid && api.uuid && item.uuid === api.uuid && item.files && api.files) { api.files = item.files; + } else if (item.files && api.files) { + this.margeFiles(item.files, api.files); } }); }); @@ -476,6 +489,7 @@ export default { } }, }, + created() { this.init(); },