From 3db60678b81cae1424a5ed3ecf6479902b9d2bae Mon Sep 17 00:00:00 2001 From: metersphere-bot <78466014+metersphere-bot@users.noreply.github.com> Date: Thu, 1 Apr 2021 19:21:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AD=A5=E9=AA=A4=E6=B2=A1=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=20(#1810)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/definition/components/case/ApiCaseList.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue index a6db51ab96..e740dc64ac 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue @@ -162,8 +162,8 @@ this.condition.projectId = this.projectId; this.condition.apiDefinitionId = this.api.id; this.$post("/api/testcase/list", this.condition, response => { - this.apiCaseList = response.data; - this.apiCaseList.forEach(apiCase => { + let data = response.data; + data.forEach(apiCase => { if (apiCase.tags && apiCase.tags.length > 0) { apiCase.tags = JSON.parse(apiCase.tags); this.$set(apiCase, 'selected', false); @@ -175,6 +175,7 @@ apiCase.request.hashTree = []; } }) + this.apiCaseList = data; this.addCase(); }); }, @@ -224,10 +225,11 @@ } this.result = this.$post("/api/testcase/list", this.condition, response => { + let data = []; if (response.data) { - this.apiCaseList = response.data; + data = response.data; } - this.apiCaseList.forEach(apiCase => { + data.forEach(apiCase => { if (apiCase.tags && apiCase.tags.length > 0) { apiCase.tags = JSON.parse(apiCase.tags); this.$set(apiCase, 'selected', false); @@ -240,6 +242,7 @@ } }) + this.apiCaseList = data; if (!this.useEnvironment && this.apiCaseList[0] && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) { this.useEnvironment = this.apiCaseList[0].request.useEnvironment; this.environment = this.useEnvironment;