Browse Source

优化菜单判断

test
smallchill 4 years ago
parent
commit
91cc9f67ca
  1. 2
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java

2
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java

@ -228,7 +228,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
} }
if (menu.getParentId() != null && menu.getId() == null) { if (menu.getParentId() != null && menu.getId() == null) {
Menu parentMenu = baseMapper.selectById(menu.getParentId()); Menu parentMenu = baseMapper.selectById(menu.getParentId());
if (parentMenu.getCategory() != 1) { if (parentMenu != null && parentMenu.getCategory() != 1) {
throw new ServiceException("父节点只可选择菜单类型!"); throw new ServiceException("父节点只可选择菜单类型!");
} }
} }

Loading…
Cancel
Save