| | |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.TreeSelect; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.vo.MetaVo; |
| | | import com.ruoyi.system.domain.vo.RouterVo; |
| | | import com.ruoyi.system.mapper.SysMenuMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMenuMapper; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private SysMenuMapper menuMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleMenuMapper roleMenuMapper; |
| | |
| | | @Override |
| | | public List<Integer> selectMenuListByRoleId(Long roleId) |
| | | { |
| | | return menuMapper.selectMenuListByRoleId(roleId); |
| | | SysRole role = roleMapper.selectRoleById(roleId); |
| | | return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); |
| | | } |
| | | |
| | | /** |
| | |
| | | router.setName(getRouteName(menu)); |
| | | router.setPath(getRouterPath(menu)); |
| | | router.setComponent(getComponent(menu)); |
| | | router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); |
| | | router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()))); |
| | | List<SysMenu> cMenus = menu.getChildren(); |
| | | if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) |
| | | { |
| | |
| | | children.setPath(menu.getPath()); |
| | | children.setComponent(menu.getComponent()); |
| | | children.setName(StringUtils.capitalize(menu.getPath())); |
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); |
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()))); |
| | | childrenList.add(children); |
| | | router.setChildren(childrenList); |
| | | } |