public async Task <IActionResult> Login(usersModel um) { int reslut = await sa.Login(um); if (ModelState.IsValid) { if (reslut > 0) { string name = sa.Ro(um); HttpContext.Session.SetString("User_name", um.User_name); List <roleModel> aa = await iro.RoleSelect(); foreach (roleModel item in aa) { if (item.user_identity == name) { HttpContext.Session.SetString("Qid", item.r_id.ToString()); } } return(Redirect("/Main/left")); //return Redirect("登陆成功"); } else { return(Content("<script>alert('登录失败');</script>")); } } else { return(View(um)); } }