【更新】移动端授权错误修改,按钮未显示问题待修复

This commit is contained in:
小诺
2023-02-04 01:33:28 +08:00
parent ba0ed7978f
commit 0c67454008
2 changed files with 18 additions and 14 deletions

View File

@@ -211,21 +211,20 @@ public class MobileMenuServiceImpl extends ServiceImpl<MobileMenuMapper, MobileM
List<MobileMenu> mobileModuleList = CollectionUtil.newArrayList();
List<MobileMenu> mobileMenuList = CollectionUtil.newArrayList();
List<MobileMenu> mobileButtonList = CollectionUtil.newArrayList();
if (ObjectUtil.isEmpty(allModuleAndMenuList)) {
// 返回空列表
return CollectionUtil.newArrayList();
}
allModuleAndMenuList.forEach(mobileMenu -> {
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.MODULE.getValue())) mobileModuleList.add(mobileMenu);
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.MENU.getValue())) mobileMenuList.add(mobileMenu);
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.BUTTON.getValue())) mobileMenuList.add(mobileMenu);
});
List<JSONObject> leafMenuList = CollectionUtil.newArrayList();
MobileMenu rootMobileMenu = new MobileMenu();
rootMobileMenu.setId("0");
rootMobileMenu.setParentId("-1");
rootMobileMenu.setSortCode(-1);
mobileMenuList.add(rootMobileMenu);
List<TreeNode<String>> treeNodeList = mobileMenuList.stream().map(mobileMenu ->
new TreeNode<>(mobileMenu.getId(), mobileMenu.getParentId(),
mobileMenu.getTitle(), mobileMenu.getSortCode())).collect(Collectors.toList());
List<Tree<String>> treeList = TreeUtil.build(treeNodeList, "-1");
List<Tree<String>> treeList = TreeUtil.build(treeNodeList, "0");
mobileMenuList.forEach(mobileMenu -> {
boolean isLeafMenu = this.getChildListById(mobileMenuList, mobileMenu.getId(), false).size() == 0;
if(isLeafMenu) {