diff --git a/crm-auth/src/main/java/com/crm/auth/service/impl/ResourceServiceImpl.java b/crm-auth/src/main/java/com/crm/auth/service/impl/ResourceServiceImpl.java index 041c789..f39410c 100644 --- a/crm-auth/src/main/java/com/crm/auth/service/impl/ResourceServiceImpl.java +++ b/crm-auth/src/main/java/com/crm/auth/service/impl/ResourceServiceImpl.java @@ -178,6 +178,10 @@ public class ResourceServiceImpl implements IResourceService { throw new BusinessErrorException(CODE_RESOURCE_INVALID, "父节点不存在:parentId=" + node.getParentId()); } MenuType parentType = MenuType.fromCode(parent.getMenuType()); + if (parentType == null) { + throw new BusinessErrorException(CODE_RESOURCE_INVALID, + "父节点类型未知:menuType=" + parent.getMenuType()); + } if (!MenuType.isLegalChild(parentType, childType)) { String msg = switch (parentType) {