|
@@ -783,7 +783,7 @@ public class KwsMenuService {
|
|
|
*/
|
|
*/
|
|
|
private List<KwsMenuResVo> supplementButtonsWithRights(List<KwsMenuResVo> menuList, FindMenuTreePojo pojo, Integer clientType) {
|
|
private List<KwsMenuResVo> supplementButtonsWithRights(List<KwsMenuResVo> menuList, FindMenuTreePojo pojo, Integer clientType) {
|
|
|
log.info("开始基于权限表补充按钮,clientType={}, entId={}, roleIds={}, 原菜单数={}",
|
|
log.info("开始基于权限表补充按钮,clientType={}, entId={}, roleIds={}, 原菜单数={}",
|
|
|
- clientType, pojo.getEntId(), pojo.getRoleIds(), menuList.size());
|
|
|
|
|
|
|
+ clientType, pojo.getEntId(), LoginUserHolder.getCurrentRoleId(), menuList.size());
|
|
|
|
|
|
|
|
// 1. 提取目录节点 id,作为按钮的 parentId 查询范围
|
|
// 1. 提取目录节点 id,作为按钮的 parentId 查询范围
|
|
|
List<Long> menuTypeIds = menuList.stream()
|
|
List<Long> menuTypeIds = menuList.stream()
|
|
@@ -800,8 +800,8 @@ public class KwsMenuService {
|
|
|
LambdaQueryWrapper<KwsMenuRights> rightsWrapper = Wrappers.lambdaQuery(KwsMenuRights.class)
|
|
LambdaQueryWrapper<KwsMenuRights> rightsWrapper = Wrappers.lambdaQuery(KwsMenuRights.class)
|
|
|
.eq(KwsMenuRights::getDelFlag, Global.NO)
|
|
.eq(KwsMenuRights::getDelFlag, Global.NO)
|
|
|
.select(KwsMenuRights::getMenuId);
|
|
.select(KwsMenuRights::getMenuId);
|
|
|
- if (CollectionUtils.isNotEmpty(pojo.getRoleIds())) {
|
|
|
|
|
- rightsWrapper.in(KwsMenuRights::getRoleId, pojo.getRoleIds());
|
|
|
|
|
|
|
+ if (Objects.nonNull(LoginUserHolder.getCurrentRoleId())) {
|
|
|
|
|
+ rightsWrapper.eq(KwsMenuRights::getRoleId,LoginUserHolder.getCurrentRoleId());
|
|
|
}
|
|
}
|
|
|
if (pojo.getEntId() != null) {
|
|
if (pojo.getEntId() != null) {
|
|
|
rightsWrapper.eq(KwsMenuRights::getEntId, pojo.getEntId());
|
|
rightsWrapper.eq(KwsMenuRights::getEntId, pojo.getEntId());
|
|
@@ -813,7 +813,7 @@ public class KwsMenuService {
|
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|
|
|
if (authorizedMenuIds.isEmpty()) {
|
|
if (authorizedMenuIds.isEmpty()) {
|
|
|
log.info("基于权限表补充按钮结束,kws_menu_rights 未查到授权菜单,entId={}, roleIds={}",
|
|
log.info("基于权限表补充按钮结束,kws_menu_rights 未查到授权菜单,entId={}, roleIds={}",
|
|
|
- pojo.getEntId(), pojo.getRoleIds());
|
|
|
|
|
|
|
+ pojo.getEntId(), LoginUserHolder.getCurrentRoleId());
|
|
|
return menuList;
|
|
return menuList;
|
|
|
}
|
|
}
|
|
|
log.debug("基于权限表补充按钮,授权菜单数={}", authorizedMenuIds.size());
|
|
log.debug("基于权限表补充按钮,授权菜单数={}", authorizedMenuIds.size());
|