public ActionResult PhoneMessage(string phoneNum, string verifyCode) { string VerifyCode = (string)TempData["verifyCode"]; if (verifyCode != VerifyCode) { return(Json(new AjaxResult { Status = "error", ErrorMsg = "验证码错误" })); } string userName = "******"; string appKey = "be4e558596caefa4720eb8"; string templateId = "436"; string code = new Random().Next(100000, 999999).ToString(); TempData["code"] = code; TempData["phoneNum"] = phoneNum; var result = MVCHelper.SendMessage(userName, appKey, templateId, code, phoneNum); //ViewBag.Phone = GetPhoneNum(phoneNum); result.phoneNum = phoneNum; return(Json(result)); }