Пример #1
0
        public ActionResult AjaxFindPasswordByPhone(FormCollection form)
        {
            string validatedCode = Request["ValidatedCode"].ToString();

            if (CookieHelper.GetCookie <String>("VerifyCode").ToLower() == validatedCode.ToLower())
            {
                string customerStr = Request["CustomerID"].ToString();
                if (LoginFacade.IsExistCustomer(customerStr))//存在该用户名
                {
                    CustomerInfo customer = CustomerFacade.GetCustomerByID(customerStr);
                    if (string.IsNullOrEmpty(customer.CellPhone))
                    {
                        return(Json("不存在该用户的手机号码", JsonRequestBehavior.AllowGet));
                    }
                    if (!CustomerFacade.CheckCustomerPhoneValided(customer.SysNo))
                    {
                        return(Json("用户手机密码没有通过验证", JsonRequestBehavior.AllowGet));
                    }

                    CookieHelper.SaveCookie <string>("FindPasswordCustomerID", customerStr);
                    CookieHelper.SaveCookie <string>("FindPasswordCustomerCellPhone", customer.CellPhone);
                    CookieHelper.SaveCookie <string>("FindPasswordCustomerSysNo", customer.SysNo.ToString());
                    return(Json(customer.CellPhone, JsonRequestBehavior.AllowGet));
                }
                return(Json("不存在该用户", JsonRequestBehavior.AllowGet));
            }
            return(Json("验证码不正确", JsonRequestBehavior.AllowGet));
        }