fix: 修复超管用户获取菜单路由排序无效问题

This commit is contained in:
Ray.Hao
2025-01-14 18:10:41 +08:00
parent 41de1ea34a
commit 9fb9e1193b

View File

@@ -152,9 +152,10 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
List<Menu> menuList;
if (SecurityUtils.isRoot()) {
// 超级管理员获取所有菜单
menuList = this.list(new LambdaQueryWrapper<Menu>().ne(
Menu::getType, MenuTypeEnum.BUTTON.getValue()
));
menuList = this.list(new LambdaQueryWrapper<Menu>()
.ne(Menu::getType, MenuTypeEnum.BUTTON.getValue())
.orderByAsc(Menu::getSort)
);
} else {
menuList = this.baseMapper.getMenusByRoleCodes(roleCodes);
}