110,536
社区成员
发帖
与我相关
我的任务
分享
[HttpPost]
public ActionResult Register2(string TEL, string TELVerification)
{
//重新发送短信验证码
if (TELVerification == null)
{
string SMSCode = Security.CreateVerificationText(6);
TempData[TEL] = SMSCode.ToUpper();
string state = SMSVerificationCommon.Send(SMSCode, TEL);
if (state!= "发送成功")
{
ModelState.AddModelError("TELVerification", state);
}
}
else
{//前往注册成功
if (userBLL.Exist(TEL))
{
ModelState.AddModelError("TEL", "手机号已注册");
}
if (TELVerification == null ||TempData[TEL]==null|| TELVerification.ToUpper() != TempData[TEL].ToString().ToUpper())
{
ModelState.AddModelError("TELVerification", "验证码错误");
}
else
{
return Redirect("/register/register3?TEL="+TEL);
//return RedirectToAction("Register1", "Register");
}
}
return View();
}
public ActionResult Register3(string TEL)
{
//初始化注册成功界面
ViewBag.TEL = TEL;
return View();
}
从2跳到3,调试的时候,已经调过来了,TEL也是传过来的。