예제 #1
0
        /// <summary>
        /// 获取账套的菜单,用于Host管理页设置帮助文档
        /// </summary>
        /// <returns></returns>
        public List <MenuTreeDto> GetFullTenancyMenuTreeJson()
        {
            List <MenuTreeDto> menuTreeDtos = new List <MenuTreeDto>();
            var menu = _menuManager.LoadDefaultMenus();

            menuTreeDtos = menu.MapTo <List <MenuTreeDto> >();
            FilterByTenancySide(menuTreeDtos, MultiTenancySides.Tenant);
            return(menuTreeDtos.OrderBy(o => o.Order).ToList());
        }
예제 #2
0
        /// <summary>
        /// 获取用户的菜单
        /// </summary>
        /// <returns></returns>
        public object GetMenuTreeJson()
        {
            List <MenuTreeDto> menuTreeDtos = new List <MenuTreeDto>();
            //获取用户设置的菜单
            string usermenudata = _menuManager.LoadUserSettingMenusData(AbpSession.UserId);

            //有设定的菜单
            if (!string.IsNullOrEmpty(usermenudata))
            {
                menuTreeDtos = Newtonsoft.Json.JsonConvert.DeserializeObject <List <MenuTreeDto> >(usermenudata);
            }
            //没有从默认的菜单中获取
            else
            {
                var menu = _menuManager.LoadDefaultMenus();
                menuTreeDtos = menu.MapTo <List <MenuTreeDto> >();
            }



            return(menuTreeDtos);
        }