Browse Source

🎉 优化判断

test
smallchill 6 years ago
parent
commit
439f3e2f2c
  1. 4
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java

4
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<MenuMapper, Menu> implements IM
@Override
public List<MenuVO> routes(String roleId) {
if (StringUtil.isBlank(roleId)) {
return null;
}
List<Menu> allMenus = baseMapper.allMenu();
List<Menu> roleMenus = baseMapper.roleMenu(Func.toLongList(roleId));
List<Menu> routes = new LinkedList<>(roleMenus);

Loading…
Cancel
Save