From 059db90dda4d13344483a9bf3ec94c53a64f1e0e Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 21 Feb 2024 15:29:01 +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=87=AA=E5=AE=9A=E4=B9=89sql=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=8E=AF=E5=A2=83=EF=BC=8C=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=87=E6=8D=A2=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=1034716 --user=王孝刚 【接口测试】github#28534,接口自动化,编辑场景 sql请求 切换同名数据源,能够生效,保存后关闭,再次进入页面切换环境的数据源,同名数据源没有切换过去 https://www.tapd.cn/55049933/s/1463369 --- .../src/business/automation/scenario/EditApiScenario.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue index 64dc2a9673..871c1ecfdc 100644 --- a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue +++ b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue @@ -2216,6 +2216,7 @@ export default { if (typeArray.indexOf(stepArray[i].type) !== -1) { stepArray[i].originalDataSourceId = stepArray[i].dataSourceId; stepArray[i].originalEnvironmentId = stepArray[i].environmentId; + console.log(stepArray[i].originalDataSourceId); } if (!stepArray[i].hashTree) { stepArray[i].hashTree = []; @@ -2408,7 +2409,7 @@ export default { let currentEnvironment = {}; this.environments.forEach((environment) => { // 找到原始环境和数据源名称 - if (environment.id === request.environmentId && environment.id === envId) { + if (environment.id === request.originalEnvironmentId !== envId) { parseEnvironment(environment); if (environment.config && environment.config.databaseConfigs) { environment.config.databaseConfigs.forEach((item) => { @@ -2436,6 +2437,7 @@ export default { } } } + parseEnvironment(currentEnvironment); let flag = false; if (currentEnvironment && currentEnvironment.config && currentEnvironment.config.databaseConfigs) { currentEnvironment.config.databaseConfigs.forEach((item) => {