fix: 接口用例添加步骤没反应 (#1810)

This commit is contained in:
metersphere-bot 2021-04-01 19:21:17 +08:00 committed by GitHub
parent bbeeb808b4
commit 3db60678b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -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;