Пример #1
0
        public IViewComponentResult Invoke()
        {
            var user    = _userAccount.GetUserInfo();
            var MenuDto = _sysMenuBLL.GetMenusBy(user).Data;

            return(View(MenuDto));
        }
Пример #2
0
        public IActionResult GetMenuList()
        {
            var menuList = (List <SysMenuDto>)(_sysMenuBLL.GetMenusBy(_userAccount.GetUserInfo()).Data);

            return(Ok(new ResponseModel
            {
                Data = menuList
            }));
        }
Пример #3
0
        /// <summary>
        /// 获取角色的功能菜单
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public IActionResult GetRoleMenuList(string RoleId)
        {
            //用户可以操作的菜单
            var menuList = _sysMenuBLL.GetMenusBy(_userAccount.GetUserInfo()).Data;
            //角色所拥有的菜单
            var roleMenuList = string.IsNullOrEmpty(RoleId) ? new List <SysMenuDto>() : _sysMenuBLL.GetRoleMenuList(RoleId).Data;

            return(Ok(new ResponseModel
            {
                Data = new
                {
                    MenuList = menuList,
                    RoleMenuList = roleMenuList
                }
            }));
        }