diff --git a/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue b/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue index ce4669cc89..9f85723ba7 100644 --- a/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue +++ b/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue @@ -218,6 +218,9 @@ this.environments.forEach(environment => { parseEnvironment(environment); }); + if (!this.request.environmentId) { + this.request.environmentId = this.$store.state.useEnvironment; + } let hasEnvironment = false; for (let i in this.environments) { if (this.environments[i].id === this.request.environmentId) { diff --git a/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue b/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue index c8f5a3ef00..ffce8a4548 100644 --- a/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue +++ b/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue @@ -323,6 +323,9 @@ export default { // 深度复制 this.api = JSON.parse(JSON.stringify(this.apiData)); this.api.protocol = this.currentProtocol; + if (!this.api.environmentId) { + this.api.environmentId = this.$store.state.useEnvironment; + } this.currentRequest = this.api.request; this.runLoading = false; this.getResult();