// GET: Navbar public ActionResult Index() { ViewData["DataContext"] = DataContext; IEnumerable <Navbar> model; if (Session[DataContext.UserID] == null) { //写入缓存 model = _permmisionService.GetNavbarByUserId(DataContext.UserID); Session[DataContext.UserID] = model; } else { //读取缓存 model = Session[DataContext.UserID] as IEnumerable <Navbar>; } // return PartialView("_Navbar", new Data().navbarItems().ToList()); return(PartialView("_Sb2Navbar", NavbarIndex.Init(_permmisionService.GetNavbarByUserId(DataContext.UserID), _permmisionService.GetForbidenButtonByUserId(DataContext.UserID)))); }
// GET: Open/GetMenu public ActionResult GetMenu(string uid = "1325112032") { return(Json(NavbarIndex.Init(_permmisionService.GetNavbarByUserId(uid), _permmisionService.GetForbidenButtonByUserId(uid)), JsonRequestBehavior.AllowGet)); }
// GET: Open/GetMenu public IActionResult GetMenu(bool isWin10 = true) { return(Json(isWin10? NavbarIndex.Init(_acsService.GetMenuByUserId(DataContext.UserId), _acsService.GetForbidenButtonByUserId(DataContext.UserId)) :NavbarIndex.Init(_acsService.GetNavbarByUserId(DataContext.UserId), _acsService.GetMenuByUserId(DataContext.UserId), _acsService.GetForbidenButtonByUserId(DataContext.UserId)))); }
// GET: Open/GetMenu public ActionResult GetMenu() { return(Json(NavbarIndex.Init(_permissionProvider.Services().GetNavbarByUserId(DataContext.UserId), _permissionProvider.Services().GetForbidenButtonByUserId(DataContext.UserId)), JsonRequestBehavior.AllowGet)); }