From 784f37d67fe53305ec3406f2b561bf8d7da8ae07 Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Mon, 25 Nov 2024 14:43:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=A7=BB=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/api/utils/ApiDefinitionUtils.java | 3 +++ .../io/metersphere/plan/service/TestPlanModuleService.java | 1 + 2 files changed, 4 insertions(+) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDefinitionUtils.java b/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDefinitionUtils.java index 6c295269f0..1e8685c6e1 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDefinitionUtils.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDefinitionUtils.java @@ -29,6 +29,9 @@ public class ApiDefinitionUtils { customRequestUrl = customRequestUrl.substring(1); } if (StringUtils.isNotEmpty(customRequestUrl)) { + if (customRequestUrl.contains("?")) { + customRequestUrl = customRequestUrl.substring(0, customRequestUrl.indexOf("?")); + } String[] customUrlArr = customRequestUrl.split("/"); if (StringUtils.startsWithAny(customRequestUrl.toLowerCase(), "https://", "http://") diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanModuleService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanModuleService.java index bde04c0ec5..c300a5995c 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanModuleService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanModuleService.java @@ -167,6 +167,7 @@ public class TestPlanModuleService extends ModuleTreeService { TestPlanModuleExample example = new TestPlanModuleExample(); // 拖拽后, 父级模块下存在同名模块 example.createCriteria().andParentIdEqualTo(nodeSortDTO.getParent().getId()).andNameEqualTo(nodeSortDTO.getNode().getName()) + .andProjectIdEqualTo(nodeSortDTO.getNode().getProjectId()) .andIdNotEqualTo(nodeSortDTO.getNode().getId()); if (testPlanModuleMapper.countByExample(example) > 0) { throw new MSException(Translator.get("test_plan_module_already_exists"));