2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-03-01 e8ff379d1a31f09e4d024e96eb788e5b65e0931d
ximon-admin/src/main/java/com/sandu/ximon/admin/service/MenuService.java
@@ -35,6 +35,7 @@
public class MenuService extends BaseServiceImpl<MenuMapper, Menu> {
    private final RoleMenuRelationService roleMenuRelationService;
    /**
     * 获取角色下的菜单
     */
@@ -103,6 +104,8 @@
                .map(menu -> covertMenuNode(menu, list)).collect(Collectors.toList());
    }
    private MenuMapper menuMapper;
    public boolean delMenu(Long menuId) {
        Menu one = getById(menuId);
        if (one == null) {
@@ -114,6 +117,12 @@
        if(!RoleLevelStatus.SUPER.getCode().equals(roleLevel)){
            throw new BusinessException("超级管理员才可以删除菜单");
        }
        List<Long> list = menuMapper.listMenuIfBinding(menuId);
        if (list.size() == 0) {
        return removeById(menuId);
        }else{
            throw new BusinessException("菜单正在使用,请勿删除");
        }
    }
}