From 23b1bf78b3dd87efa61adeeb40958c3767f26030 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 23 Nov 2022 11:52:23 +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=E6=B5=8B=E8=AF=95=E9=A1=B5=E9=9D=A2=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF=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=1020077 --user=王孝刚 【接口测试】接口定义-TEST页面,生成测试数据,默认值会带引号,number值会变成string https://www.tapd.cn/55049933/s/1302381 --- .../frontend/src/business/automation/ApiAutomation.vue | 9 +++++++++ .../src/business/definition/components/body/ApiBody.vue | 3 +++ .../components/mock/Components/MockApiBody.vue | 3 +++ .../components/request/http/ApiHttpRequestForm.vue | 3 +++ 4 files changed, 18 insertions(+) diff --git a/api-test/frontend/src/business/automation/ApiAutomation.vue b/api-test/frontend/src/business/automation/ApiAutomation.vue index 9637844117..0e5344ad09 100644 --- a/api-test/frontend/src/business/automation/ApiAutomation.vue +++ b/api-test/frontend/src/business/automation/ApiAutomation.vue @@ -548,6 +548,15 @@ export default { if (item.delay) { item.delay = Number(item.delay); } + if (item.disabled || !item.disabled) { + delete item.disabled; + } + if (!item.environmentEnable || item.environmentEnable) { + delete item.environmentEnable; + } + if (item.refEevMap) { + delete item.refEevMap; + } if (item.body && item.body.kvs) { item.body.kvs.forEach((v) => { if (v.files) { diff --git a/api-test/frontend/src/business/definition/components/body/ApiBody.vue b/api-test/frontend/src/business/definition/components/body/ApiBody.vue index c58228e8d9..9c92a422b5 100644 --- a/api-test/frontend/src/business/definition/components/body/ApiBody.vue +++ b/api-test/frontend/src/business/definition/components/body/ApiBody.vue @@ -159,6 +159,9 @@ export default { }, assignKey(to, from, key) { + if (key === 'type') { + return; + } let val = from[key]; if (val === undefined || val === null) { return; diff --git a/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue b/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue index a3a20e676a..5df0ea7c81 100644 --- a/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue +++ b/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue @@ -138,6 +138,9 @@ export default { }, assignKey(to, from, key) { + if (key === 'type') { + return; + } let val = from[key]; if (val === undefined || val === null) { return; diff --git a/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue b/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue index 7460d46bb0..d83a0037f6 100644 --- a/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue +++ b/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue @@ -542,6 +542,9 @@ export default { }, assignKey(to, from, key) { + if (key === 'type') { + return; + } let val = from[key]; if (val === undefined || val === null) {