| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | |
| | | |
| | | @Autowired |
| | | private SysRoleMenuMapper roleMenuMapper; |
| | | |
| | | |
| | | @Value("${isAdmin}") |
| | | private List<Long> isAdmin; |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | |
| | | @Override |
| | | public List<SysMenu> selectMenuTreeByUserId(Long userId) { |
| | | List<SysMenu> menus = null; |
| | | if (SecurityUtils.isAdmin(userId)) { |
| | | // if (SecurityUtils.isAdmin(userId)) { |
| | | if (userId != null && isAdmin.contains(userId)) { |
| | | menus = menuMapper.selectMenuTreeAll(); |
| | | } else { |
| | | menus = menuMapper.selectMenuTreeByUserId(userId); |