Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
 public ActionResult ForgotPassword()
 {
     var model = new ForgotPasswordViewModel() { Message = String.Empty };
     return View(model);
 }