授权菜单查询条件调整

master
zhangxiaofeng 5 months ago
parent 6516683213
commit 003bc56127

@ -90,7 +90,7 @@ public class MenuInput
/// <summary>
/// 是否启用数据授权
/// </summary>
public bool IsEnableDataScope { get; set; }
public bool? IsEnableDataScope { get; set; }
}
public class AddMenuInput : MenuInput

@ -440,7 +440,8 @@ public class SysMenuService : ISysMenuService, IDynamicApiController, ITransient
List<MenuTreeOutput> menus = await _sysMenuRep.AsQueryable()
.LeftJoin<SysApp>((t1, t2) => t1.Application == t2.Code)
.Where(t1 => t1.Status == (int)CommonStatus.ENABLE && t1.IsEnableDataScope)
.Where(t1 => t1.Status == (int)CommonStatus.ENABLE)
.WhereIF(input.IsEnableDataScope != null, t1 => t1.IsEnableDataScope == input.IsEnableDataScope)
.WhereIF(menuIdList.Any(), t1 => menuIdList.Contains(t1.Id))
.OrderBy(t1 => t1.Sort)
.Select((t1, t2) => new MenuTreeOutput

Loading…
Cancel
Save