public IActionResult Index() { string userHex = HttpContext.Session.GetString("_userId"); if (string.IsNullOrEmpty(userHex)) { //没登陆 return(Redirect("/Auth/login")); } User user = GetUserBySession(); if (user == null) { //身份无效 return(Redirect("/Auth/login")); } ViewBag.user = user; ViewBag.msg = LanguageResource.GetMsg(); ViewBag.member = LanguageResource.GetMember(); int countNote = NoteService.CountNote(user.UserId); int countBlog = NoteService.CountBlog(user.UserId); ViewBag.countNote = countNote; ViewBag.countBlog = countBlog; ViewBag.title = "个人中心"; //return View("Views/Home/About.cshtml"); return(View("Views/Member/Index.cshtml")); }
public IActionResult Avatar() { string userHex = HttpContext.Session.GetString("_userId"); if (string.IsNullOrEmpty(userHex)) { //没登陆 return(Redirect("/Auth/login")); } User user = GetUserBySession(); if (user == null) { //身份无效 return(Redirect("/Auth/login")); } ViewBag.user = user; ViewBag.msg = LanguageResource.GetMsg(); ViewBag.member = LanguageResource.GetMember(); ViewBag.title = "头像"; return(View("Views/Member/user/avatar.cshtml")); }