Пример #1
0
        /// <summary>
        /// 获取无状态的菜单信息
        /// </summary>
        /// <param name="sysPermissionService"></param>
        /// <returns></returns>
        public async Task <IActionResult> OnGetMenuTreeAsync([FromServices] SysPermissionService sysPermissionService)
        {
            IEnumerable <SysMenuDto> sysMenus = await sysPermissionService.GetCurrentUserMenuDtoAsync();

            var results = await GetSysMenuTreesMainRecursiveAsync(sysMenus);

            return(Ok(results));
        }
Пример #2
0
        public async Task <IActionResult> OnGetMenuResourceAsync([FromServices] SysPermissionService sysPermissionService)
        {
            IEnumerable <SysMenuDto> sysMenus = await sysPermissionService.GetCurrentUserMenuDtoAsync();

            var results       = getSysMenuTreesMainRecursive(sysMenus);
            var resourceCodes = await sysPermissionService.GetCurrentUserResourcesDtoAsync();

            return(Ok(new { menuList = results, resourceCodes }));
        }