diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java index 3606c65dd6..352e6d63d1 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java @@ -76,10 +76,16 @@ public class ElementUtil { ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class); ApiTestEnvironmentWithBLOBs environment = environmentService.get(environmentId); if (environment != null && environment.getConfig() != null) { + if(StringUtils.isEmpty(projectId)){ + projectId = environment.getProjectId(); + } if (StringUtils.equals(environment.getName(), MockConfigStaticData.MOCK_EVN_NAME)) { isMockEnvironment = true; } // 单独接口执行 + if (StringUtils.isEmpty(projectId)) { + projectId = environment.getProjectId(); + } Map map = new HashMap<>(); map.put(projectId, JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class)); return map; diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index a3665e916c..e5d7e1d119 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -167,8 +167,12 @@ public class MsHTTPSamplerProxy extends MsTestElement { sampler.setDoMultipart(this.isDoMultipartPost()); if (config.getConfig() == null) { // 单独接口执行 - this.setProjectId(config.getProjectId()); - config.setConfig(ElementUtil.getEnvironmentConfig(this.useEnvironment, this.getProjectId(), this.isMockEnvironment())); + if (StringUtils.isNotEmpty(config.getProjectId())) { + this.setProjectId(config.getProjectId()); + } + String projectId = this.getProjectId(); + config.setConfig(ElementUtil.getEnvironmentConfig(this.useEnvironment, projectId, this.isMockEnvironment())); + this.setProjectId(projectId); } config.compatible(this); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 21f25bc99d..2d18b809ff 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -1822,12 +1822,12 @@ public class ApiAutomationService { List scenarioNames = extApiScenarioMapper.selectNameByIdIn(scenarioIdList); if (StringUtils.isNotEmpty(deleteScenarioName) && CollectionUtils.isNotEmpty(scenarioNames)) { - String nameListStr = "["; + String nameListStr = " "; for (String name : scenarioNames) { nameListStr += name + ","; } if (nameListStr.length() > 1) { - nameListStr = nameListStr.substring(0, nameListStr.length() - 1) + "]"; + nameListStr = nameListStr.substring(0, nameListStr.length() - 1) + " "; } String msg = deleteScenarioName + " " + Translator.get("delete_check_reference_by") + ": " + nameListStr + " "; checkMsgList.add(msg); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml index b8a0834ce2..7a7d8343c0 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml @@ -203,9 +203,6 @@ ${order.name} ${order.type} - - ${request.limit} - ) apiScenarioReport union @@ -272,9 +269,6 @@ ${order.name} ${order.type} - - ${request.limit} - ) apiDefinitionReport ) r