From 4552cc58ac2c1bbee11f6eecdb023d11dd4ef704 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 4 May 2023 17:00:02 +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=E5=9C=BA=E6=99=AF=E6=89=A7=E8=A1=8C=E5=8D=95?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E6=97=B6=E6=8F=90=E7=A4=BAcsv=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=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=1025964 --user=王孝刚 【接口测试】新建场景-添加csv场景变量-单步骤调试失败引用csv文件失败 https://www.tapd.cn/55049933/s/1368421 --bug=1025973 --user=王孝刚 【接口测试】api-点击测试-调试失败 https://www.tapd.cn/55049933/s/1368420 --- .../components/api/automation/scenario/EditApiScenario.vue | 3 +-- .../api/definition/components/EditCompleteContainer.vue | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 7517ff90f2..85b2af0bb2 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -1135,8 +1135,7 @@ export default { setVariables(v, headers) { this.currentScenario.variables = v; this.currentScenario.headers = headers; - if (this.path.endsWith("/update")) { - // 直接更新场景防止编辑内容丢失 + if (v && v.length> 0 || headers && headers.length > 0) { this.editScenario(); } if (this.$refs.maximizeHeader) { diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue index 34d15d409f..a9675f33f7 100644 --- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue +++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue @@ -228,6 +228,12 @@ export default { } if (this.currentApi.request) { this.currentApi.request.clazzName = TYPE_TO_C.get(this.currentApi.request.type); + if (this.currentApi.request.hashTree) { + let hasNull = this.currentApi.request.hashTree.filter(v => !v || v == null); + if (hasNull && hasNull.length > 0) { + this.currentApi.request.hashTree = []; + } + } this.sort(this.currentApi.request.hashTree); } },