Beispiel #1
0
        public ActionResult GetSecurityCode(string mobileCode)
        {
            if (!ValidateUtil.IsValidMobile(mobileCode))
            {
                throw new Exception("手机格式不正确,请输入正确格式的手机号码。");
            }
            var data = accountBLL.GetSecurityCode(mobileCode);

            if (!string.IsNullOrEmpty(data))
            {
                SmsModel smsModel = new SmsModel();
                smsModel.account = Config.GetValue("SMSAccount");
                smsModel.pswd    = Config.GetValue("SMSPswd");
                smsModel.url     = Config.GetValue("SMSUrl");
                smsModel.mobile  = mobileCode;
                smsModel.msg     = "验证码 " + data + ",(请确保是本人操作且为本人手机,否则请忽略此短信)";
                SmsHelper.SendSmsByJM(smsModel);
            }
            return(Success("获取成功。"));
        }