chenxiaofei 9 ore în urmă
părinte
comite
8f2fc49e1c

+ 4 - 4
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java

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