diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java index c4701d3d..cd1b52b7 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java @@ -26,6 +26,7 @@ import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.node.ForestNodeMerger; import org.springblade.core.tool.support.Kv; import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.dto.MenuDTO; import org.springblade.system.entity.Menu; import org.springblade.system.entity.RoleMenu; @@ -60,6 +61,9 @@ public class MenuServiceImpl extends ServiceImpl implements IM @Override public List routes(String roleId) { + if (StringUtil.isBlank(roleId)) { + return null; + } List allMenus = baseMapper.allMenu(); List roleMenus = baseMapper.roleMenu(Func.toLongList(roleId)); List routes = new LinkedList<>(roleMenus);