| | |
| | | public List<ResEntity> selectRes(String uid); |
| | | |
| | | /** |
| | | * 查询所有资源 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<ResEntity> selectAllRes(); |
| | | |
| | | /** |
| | | * 根据用户Uid查询菜单授权 |
| | | * |
| | | * @param uid |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ResEntity> selectAllRes() { |
| | | return permsMapper.selectAllRes(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MenusAuthEntity> selectMenus(String uid) { |
| | | String key = RedisCacheKey.permsMenusKey(uid); |
| | | Object obj = redisService.get(key); |
| | |
| | | * 检查资源权限 |
| | | */ |
| | | private ResEntity getResEntity(UserEntity ue, int resId) { |
| | | String uid = StaticData.ADMIN.equals(ue.getUid()) ? null : ue.getUid(); |
| | | List<ResEntity> rs = permsService.selectRes(uid); |
| | | List<ResEntity> rs = StaticData.ADMIN.equals(ue.getUid()) ? permsService.selectAllRes() : permsService.selectRes(ue.getUid()); |
| | | if (null == rs || rs.isEmpty()) { |
| | | return null; |
| | | } |
| | |
| | | order by e.id; |
| | | </select> |
| | | |
| | | <select id="selectAllRes" resultType="com.moon.server.entity.sys.ResEntity"> |
| | | select distinct e.* |
| | | from lf.sys_res e |
| | | where e.status between 1 and 2 |
| | | order by e.id; |
| | | </select> |
| | | |
| | | <select id="selectMenus" resultType="com.moon.server.entity.all.MenusAuthEntity"> |
| | | select distinct e.id,e.pid,e.cn_name,e.en_name,e.url,e.perms,e.type,e.css,e.icon,e.level,e.order_num,e.is_show |
| | | from lf.sys_user a |