| | |
| | | |
| | | public List<MenuDTO> GetAllMenu() |
| | | { |
| | | List<Sys_Menu> menus = base.QueryData(x => x.Enable == 1 || x.Enable == 2).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); |
| | | List<Sys_Menu> menus = base.QueryData(x => (x.Enable == 1 || x.Enable == 2) && x.MenuType == App.User.MenuType).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); |
| | | List<MenuDTO> _menus = _mapper.Map<List<MenuDTO>>(menus); |
| | | _menus.ForEach(x => |
| | | { |
| | | x.MenuType ??= 0; |
| | | if (!string.IsNullOrEmpty(x.Auth) && x.Auth.Length > 10) |
| | | { |
| | | try |
| | | { |
| | | x.Actions = x.Auth.DeserializeObject<List<ActionDTO>>(); |
| | | } |
| | | catch { } |
| | | } |
| | | x.Actions ??= new List<ActionDTO>(); |
| | | }); |
| | | string test = _menus.Serialize(); |
| | | return _menus; |
| | | } |
| | | |
| | | public List<MenuDTO> GetAllMenuPDA() |
| | | { |
| | | List<Sys_Menu> menus = base.QueryData(x => (x.Enable == 1 || x.Enable == 2) && x.MenuType == 1).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); |
| | | List<MenuDTO> _menus = _mapper.Map<List<MenuDTO>>(menus); |
| | | _menus.ForEach(x => |
| | | { |
| | | if (!string.IsNullOrEmpty(x.Auth) && x.Auth.Length > 10) |
| | | { |
| | | try |
| | |
| | | ParentId = a.ParentId, |
| | | TableName = (a.TableName ?? "").ToLower(), |
| | | UserAuth = a.Auth, |
| | | MenuType = a.MenuType ?? 0 |
| | | MenuType = a.MenuType |
| | | }).ToList(); |
| | | return MenuActionToArray(permissions); |
| | | } |
| | |
| | | { |
| | | //没æredis/memoryç¼åè§è²ççæ¬å·æä¸å½åæå¡å¨çè§è²çæ¬å·ä¸åæ¶ï¼å·æ°ç¼å |
| | | |
| | | List<Permissions> _permissions = QueryTabs<Sys_Menu, Sys_RoleAuth, Permissions>((a, b) => new object[] { JoinType.Inner, a.MenuId == b.MenuId }, (a, b) => new Permissions { MenuId = a.MenuId, ParentId = a.ParentId, TableName = (a.TableName ?? "").ToLower(), MenuAuth = a.Auth, UserAuth = b.AuthValue ?? "", MenuType = a.MenuType ?? 0 }, (a, b) => b.RoleId == roleId, x => true); |
| | | List<Permissions> _permissions = QueryTabs<Sys_Menu, Sys_RoleAuth, Permissions>((a, b) => new object[] { JoinType.Inner, a.MenuId == b.MenuId }, (a, b) => new Permissions { MenuId = a.MenuId, ParentId = a.ParentId, TableName = (a.TableName ?? "").ToLower(), MenuAuth = a.Auth, UserAuth = b.AuthValue ?? "", MenuType = a.MenuType }, (a, b) => b.RoleId == roleId, x => true); |
| | | |
| | | ActionToArray(_permissions); |
| | | |
| | |
| | | p.Icon, |
| | | p.Enable, |
| | | // 2022.03.26å¢ç§»å¨ç«¯å èåç±»å |
| | | MenuType = p.MenuType ?? 0, |
| | | p.MenuType, |
| | | p.CreateDate, |
| | | p.Creater, |
| | | p.TableName, |