|
@@ -26,6 +26,7 @@
|
|
|
package org.springblade.modules.system.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -90,7 +91,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<MenuVO> routes(String roleId, Long topMenuId,String clientId,Integer systemType) {
|
|
|
+ public List<MenuVO> routes(String roleId, Long topMenuId,String clientId,Integer systemType,String sysType) {
|
|
|
if (StringUtil.isBlank(roleId)) {
|
|
|
return null;
|
|
|
}
|
|
@@ -98,7 +99,18 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
|
|
|
List<Menu> roleMenus;
|
|
|
// 超级管理员并且不是顶部菜单请求则返回全部菜单
|
|
|
if (AuthUtil.isAdministrator() && Func.isEmpty(topMenuId)) {
|
|
|
- roleMenus = allMenus;
|
|
|
+ QueryWrapper<Menu> menuQueryWrapper = new QueryWrapper<>();
|
|
|
+ LambdaQueryWrapper<Menu> lambda = menuQueryWrapper.lambda();
|
|
|
+ lambda.eq(Menu::getIsDeleted, 0)
|
|
|
+ .eq(Menu::getCategory,1)
|
|
|
+ .eq(StringUtil.isNotBlank(sysType),Menu::getSysType,sysType);
|
|
|
+ if(systemType!=null){
|
|
|
+ lambda.eq(Menu::getSystemType,systemType);
|
|
|
+ }else{
|
|
|
+ lambda.isNull(Menu::getSystemType);
|
|
|
+ }
|
|
|
+ roleMenus = baseMapper.selectList(lambda);
|
|
|
+
|
|
|
}
|
|
|
// 非超级管理员并且不是顶部菜单请求则返回对应角色权限菜单
|
|
|
else if (!AuthUtil.isAdministrator() && Func.isEmpty(topMenuId)) {
|