public IActionResult jiluyemian() { //法一,ViewBag特性是在作用域内才有效,因此不能写在ajax控制器中,且所有页面都要写这一段 ComHttpContext session = new ComHttpContext(); string result = session.Get("logtype"); ViewBag.session = result != null ? result : "0"; return(View()); }
//验证账号状态 public ActionResult VerifyLogin() { ComHttpContext session = new ComHttpContext(); string result = session.Get("logtype"); return(Json(new { result })); }