From afbe081d26038ecb5d684d32cfb212269b9399ed Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 7 Apr 2023 16:14:05 +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=E8=B7=A8=E9=A1=B9=E7=9B=AE=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E7=9A=84=E8=87=AA=E5=AE=9A=E4=B9=89sql=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=8B=BF=E5=88=B0=E5=8E=9F=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=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=1025195 --user=王孝刚 【接口测试】场景中跨项目复制场景B(自定义sql请求),sql请求运行环境不能选原项目中的环境 https://www.tapd.cn/55049933/s/1360280 --- .../automation/scenario/component/ApiComponent.vue | 7 +++++++ .../components/request/database/BasisParameters.vue | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue index 8e0f786a2c..b2af374138 100644 --- a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue @@ -273,6 +273,13 @@ export default { this.request.projectId = getCurrentProjectID(); } this.request.customizeReq = this.isCustomizeReq; + if (this.request.customizeReq) { + if (this.node.parent && this.node.parent.data && this.node.parent.data.length > 1) { + this.request.projectId = getCurrentProjectID(); + }else { + this.request.projectId = this.node.parent.data.projectId; + } + } if (this.currentScenario) { this.request.currentScenarioId = this.currentScenario.id; } diff --git a/api-test/frontend/src/business/definition/components/request/database/BasisParameters.vue b/api-test/frontend/src/business/definition/components/request/database/BasisParameters.vue index 15d081906b..3b546a12e2 100644 --- a/api-test/frontend/src/business/definition/components/request/database/BasisParameters.vue +++ b/api-test/frontend/src/business/definition/components/request/database/BasisParameters.vue @@ -337,7 +337,7 @@ export default { runTest() {}, itselfEnvironment(environmentId) { let id = this.request.projectId ? this.request.projectId : this.projectId; - getEnvironmentByProjectId(this.projectId).then((response) => { + getEnvironmentByProjectId(id).then((response) => { this.environments = response.data; let targetDataSourceName = undefined; let currentEnvironment = undefined;