From 3d6e6c0b52c33a20acc32ef4841815dc78684260 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 27 Jun 2023 20:07: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=E5=AF=BC=E5=85=A5=E7=94=A8=E4=BE=8B=E5=89=8D?= =?UTF-8?q?=E5=90=8E=E7=BD=AESQL=E4=BB=8D=E4=BD=BF=E7=94=A8=E6=97=A7?= =?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=1026602 --user=王孝刚 【接口测试】github#24678,如果接口用例中有前后置sql,当从A项目迁移到B项目,在B项目中查看,用例关联的前后置sql环境没有发生变化,还是老得环境。 https://www.tapd.cn/55049933/s/1387267 --- .../automation/scenario/common/JDBCProcessorContent.vue | 2 ++ .../business/definition/components/EditCompleteContainer.vue | 1 + .../src/business/definition/components/case/ApiCaseItem.vue | 3 +++ 3 files changed, 6 insertions(+) diff --git a/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue b/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue index 76225d7b99..dd367f9cc2 100644 --- a/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue +++ b/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue @@ -231,6 +231,8 @@ export default { }); if (environmentId) { this.request.environmentId = environmentId; + } else { + this.request.environmentId = null; } this.initDataSource(undefined, undefined, targetDataSourceName); }); diff --git a/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue b/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue index 7fcec33e97..ad9979df34 100644 --- a/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue +++ b/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue @@ -259,6 +259,7 @@ export default { if (stepArray[i] && stepArray[i].authManager && !stepArray[i].authManager.clazzName) { stepArray[i].authManager.clazzName = TYPE_TO_C.get(stepArray[i].authManager.type); } + stepArray[i].projectId = this.currentApi.projectId; if (stepArray[i].type === 'Assertions' && !stepArray[i].document) { stepArray[i].document = { type: 'JSON', diff --git a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue index 7854017f44..bcfc0c1abe 100644 --- a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue +++ b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue @@ -405,6 +405,9 @@ export default { this.apiCase.request.hashTree[index].document.nodeType = 'Case'; this.apiCase.request.hashTree[index].document.apiDefinitionId = this.apiCase.apiDefinitionId; } + this.apiCase.request.hashTree.forEach(item =>{ + item.projectId = this.apiCase.projectId; + }) } this.readonly = !hasPermissions('PROJECT_API_DEFINITION:READ+EDIT_CASE', 'PROJECT_API_DEFINITION:READ+CREATE_CASE', 'PROJECT_API_DEFINITION:READ+COPY_CASE'); if (this.apiCase && this.apiCase.id) {