public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model) { try { model.Message = String.Empty; if (!ModelState.IsValid) { return View(model); } var user = DataSource.Accounts.FirstOrDefault(t => t.Email == model.Email && t.Name == model.Email); if (user == null) { model.Message = "错误的用户名或者邮箱"; return View(model); } Response.Write("<script>alert('邮件已发送,请立即查收!')</script>"); return View("Login"); } catch (Exception ex) { LogHelper.Instance.WriteError(ex, GetType(), MethodBase.GetCurrentMethod().Name); throw; } }
public ActionResult ForgotPassword() { var model = new ForgotPasswordViewModel() { Message = String.Empty }; return View(model); }