|
@@ -207,13 +207,10 @@ namespace GxPress.Service.Implement.Role
|
|
|
{
|
|
|
//获取
|
|
|
var models = await systemRoleMenusRepository.GetAllAsync(roleId);
|
|
|
- var item = await menusRepository.GetAllAsync(models.Select(n => n.Id).ToList());
|
|
|
+ var item = await menusRepository.GetAllAsync(models.Select(n => n.MenuId).ToList());
|
|
|
var result = new List<MenuInResult>();
|
|
|
- result = item.Where(n => n.ParentId == 0).Select(n => _mapper.Map<MenuInResult>(n)).ToList();
|
|
|
- foreach (var request in result)
|
|
|
- {
|
|
|
- request.Children = item.Where(n => n.ParentId == request.Id).Select(n => _mapper.Map<MenuInResult>(n)).ToList();
|
|
|
- }
|
|
|
+ result = item.Select(n=>_mapper.Map<MenuInResult>(n)).ToList();
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|