Esempio n. 1
0
 public ActionResult ResetPass(string e, string t)
 {
     if (string.IsNullOrEmpty(e))
     {
         return(View("~/Views/NotFound.cshtml"));
     }
     try
     {
         var dateStr  = CommonTool.Decrypt(t);
         var sendtime = Convert.ToDateTime(dateStr);
         sendtime = sendtime.AddYears(1);
         e        = CommonTool.Decrypt(e);
         if ((DateTime.Now - sendtime) > TimeSpan.FromHours(1))
         {
             ViewBag.info = "时间已失效,请重新发送验证邮件";
             return(View("~/Views/NotFound.cshtml"));
         }
         ViewBag.email = e;
         return(View());
     }
     catch (Exception ex)
     {
         return(View("~/Views/NotFound.cshtml"));
     }
 }