Beispiel #1
0
        public string GetLastVerifiCode(dynamic _)
        {
            //接收request数据
            var recdata = this.GetResquetData <SmsModel>();

            try
            {
                #region "接口调用验证"
                //bool flag = DataValidation(recdata.DateTime, recdata.Random, recdata.Sign);

                //if (!flag)
                //{
                //    return this.WriteValidationLog("LoginModule", recdata.DeviceId);
                //}
                #endregion

                CommonBusiness bl          = new CommonBusiness();
                LoginOutModel  accountInfo = bl.CheckTelphone(recdata.data.MobileCode);
                if (accountInfo == null)
                {
                    return(SendData("手机号不存在,请检查账户!", ResponseType.Fail));
                }
                else if (accountInfo.State == 1)
                {
                    return(SendData("手机号已冻结!", ResponseType.Fail));
                }
                else if (accountInfo.State == 2)
                {
                    return(SendData("手机号已注销!", ResponseType.Fail));
                }
                else
                {
                    SmsModel smsInfo = bl.GetLastVerifiCode(recdata.data.MobileCode, recdata.data.CodeType);
                    if (smsInfo != null)
                    {
                        return(this.SendData <SmsModel>(smsInfo, "验证码发送成功!", ResponseType.Success));
                    }
                    else
                    {
                        return(SendData("验证码发送失败!", ResponseType.Fail));
                    }
                }
            }
            catch (Exception ex)
            {
                return(this.WriteExceptionLog("LoginModule", recdata.data.MobileCode, recdata.DeviceId, "验证码发送异常:" + Json.ToJson(recdata) + "[异常信息:" + ex.Message + "]", "验证码发送异常:" + ex.Message));
            }
        }