diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 16ebff0aba..15e6dd9535 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -746,6 +746,11 @@ public class ApiDefinitionService { } else { apiDefinition.setUserId(apiDefinition.getUserId()); } + if(apiDefinition.getModuleId()==null){ + if (StringUtils.isEmpty(apiDefinition.getModuleId()) || "default-module".equals(apiDefinition.getModuleId())) { + initModulePathAndId(apiDefinition.getProjectId(), apiDefinition); + } + } apiDefinition.setDescription(apiDefinition.getDescription()); List sameRequest;