Jelajahi Sumber

修改获取当前登录用户功能权限接口

songxinlu 3 tahun lalu
induk
melakukan
9c7cb677dc

+ 9 - 6
security-center/src/main/java/com/lantone/security/facade/RoleManagementFacade.java

@@ -473,10 +473,15 @@ public class RoleManagementFacade {
     private List<UserMenuResourceTreeDTO> getUserMenuResourceTreeByRoles(List<Long> roles, String type) {
         List hideMenus = null;
         //获取type下要隐藏的菜单
-        List<GetDictionaryInfoByTypeDTO> configHideMenus = dictionaryInfoFacade.getBaseMapper()
-                .getDictionaryInfoByType(DictionaryEnum.MANAGE_HIDE_MENU.getKey());
-        if (ListUtil.isNotEmpty(configHideMenus)) {
-            hideMenus = JSONArray.parseArray(JSONObject.parseObject(configHideMenus.get(0).getVal()).getString(type));
+        String dictionaryInfoStr  = dictionaryInfoFacade.getDicMap(ReturnTypeEnum.INTERFACE.getKey(),
+                Lists.newArrayList(DictionaryEnum.MANAGE_HIDE_MENU.getKey() + ""))
+                .get(DictionaryEnum.MANAGE_HIDE_MENU.getKey() + "").get("manageHideMenu");
+        if (StringUtil.isNotEmpty(dictionaryInfoStr)) {
+            try {
+                hideMenus = JSONObject.parseObject(dictionaryInfoStr).getJSONArray(type).toJavaList(Long.class);
+            }catch (Exception e){
+                e.printStackTrace();
+            }
         }
         List<UserMenuResourceTreeDTO> userMenuResourceTree = roleSoftwareMenuFacade.getBaseMapper().getUserMenuResourceTree(roles, hideMenus);
         return getTree(userMenuResourceTree);
@@ -491,8 +496,6 @@ public class RoleManagementFacade {
     private List<UserMenuResourceTreeDTO> getUserMenuResourceTreeByRoles(List<Long> loginRoles, List<Long> selectRoles, String type) {
         List hideMenus = null;
         //获取type下要隐藏的菜单
-        List<GetDictionaryInfoByTypeDTO> configHideMenus = dictionaryInfoFacade.getBaseMapper()
-                .getDictionaryInfoByType(DictionaryEnum.MANAGE_HIDE_MENU.getKey());
         String dictionaryInfoStr  = dictionaryInfoFacade.getDicMap(ReturnTypeEnum.INTERFACE.getKey(),
                 Lists.newArrayList(DictionaryEnum.MANAGE_HIDE_MENU.getKey() + ""))
                 .get(DictionaryEnum.MANAGE_HIDE_MENU.getKey() + "").get("manageHideMenu");