diff --git a/api-test/frontend/src/business/automation/scenario/common/ApiRunMode.vue b/api-test/frontend/src/business/automation/scenario/common/ApiRunMode.vue index 17fc82cc1c..27afdeee14 100644 --- a/api-test/frontend/src/business/automation/scenario/common/ApiRunMode.vue +++ b/api-test/frontend/src/business/automation/scenario/common/ApiRunMode.vue @@ -276,16 +276,17 @@ export default { showApiPopover() { let currentProjectID = getCurrentProjectID(); this.projectIds.clear(); + this.projectIds.add(currentProjectID); getApiCaseEnvironments(this.runCaseIds).then((res) => { let data = res.data; if (data) { this.caseIdEnvNameMap = data; - this.projectIds.add(currentProjectID); } this.$refs.envSelectPopover.open(); }); }, showScenarioPopover() { + let currentProjectID = getCurrentProjectID(); this.projectIds.clear(); apiScenarioEnvMap(this.request).then(res => { let data = res.data; @@ -295,6 +296,9 @@ export default { this.projectIds.add(d); } } + if (this.projectIds.size===0){ + this.projectIds.add(currentProjectID); + } this.$refs.envSelectPopover.open(); }); },