diff --git a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java index fa22a7b340..dcd9369c8d 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java @@ -307,6 +307,10 @@ public class ApiModuleService extends NodeTreeService { if (StringUtils.isNotEmpty(node.getProtocol())) { criteria.andProtocolEqualTo(node.getProtocol()); } + //同一个模块下不能有相同名字的子模块 + if(StringUtils.isNotBlank(node.getParentId())){ + criteria.andParentIdEqualTo(node.getParentId()); + } return apiModuleMapper.selectByExample(example); }