public IActionResult TeaLog(Teacher teacher) { LogMethod log = new LogMethod(); Teacher m = log.TeaLogin(teacher); if (m != null) { this.Response.Cookies.Append("Tno", m.Tno); return(RedirectToAction("Index", "Teacher")); } else { return(Content("<script>alert('登录失败,请检查账号或密码是否输入错误');history.go(-1);</script>", "text/html;charset=UTF-8")); } }