|
@@ -7,6 +7,7 @@ import com.boman.system.domain.SysRoleMenu;
|
|
|
import com.boman.system.mapper.SysRoleMenuMapper;
|
|
|
import com.boman.system.service.ISysMenuService;
|
|
|
import com.boman.web.core.api.RemoteObjService;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -76,14 +77,26 @@ public class SysRoleMenuServiceImpl implements ISysRoleMenuService{
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 功能描述: 根据前台传过来的head中判断是否包含childList中perms的btn,返回包含的
|
|
|
+ * 功能描述: 根据前台传过来的head中判断是否包含childList中perms的btn,返回包含的,但是其中有一些perms未配置
|
|
|
*
|
|
|
* @param head A M D......
|
|
|
* @param menuList menuList
|
|
|
* @return java.util.List<com.boman.system.api.domain.SysMenu>
|
|
|
*/
|
|
|
private List<SysMenu> buildBtnByHead(List<String> head, List<SysMenu> menuList) {
|
|
|
- return filter(menuList, menu -> head.contains(RoleMenuDto.getBtnFromPerms(menu.getPerms())));
|
|
|
+ List<SysMenu> result = Lists.newArrayListWithCapacity(menuList.size());
|
|
|
+ for (SysMenu menu : menuList) {
|
|
|
+ String perms = menu.getPerms();
|
|
|
+ if (isEmpty(perms)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (head.contains(RoleMenuDto.getBtnFromPerms(menu.getPerms()))) {
|
|
|
+ result.add(menu);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|