/// <summary>
        /// 生成验证码
        /// </summary>
        /// <param name="mobile">手机号码</param>
        /// <returns>验证码</returns>
        private string BuildVerifyCode(string appSign, string terminalSign, string mobile)
        {
            var db = new RepositoryFactory().BaseRepository().BeginTrans();

            try
            {
                //1.强制手机号对应验证码失效
                CancelVerifyCode(appSign, mobile);

                //1.生成验证码及失效日期
                var      dbNow      = DateTime.Now;
                string   verifyCode = VerifyCode.GenNumCode(Const.SMS_VALIDATECODE_LENGTH);
                DateTime expireDate = dbNow.AddSeconds(ConfigUtil.ValidatecodeExpire);

                //2.登记用户验证码信息
                var entity = new VerifyCodeEntity();
                entity.AppSign      = appSign;
                entity.Mobile       = mobile;
                entity.Email        = string.Empty;
                entity.VerifyCode   = verifyCode;
                entity.ExpireDate   = expireDate;
                entity.Verified     = 0;
                entity.VerifiedDate = DateTime.MinValue;
                entity.TerminalCode = terminalSign;
                entity.Description  = string.Empty;
                entity.CreateUserId = mobile;
                entity.CreateDate   = dbNow;
                db.Insert(entity);
                db.Commit();

                //3.返回产生的验证码
                return(verifyCode);
            }
            catch (Exception ex)
            {
                db.Rollback();
                LogUtil.Error(ex.StackTrace);
                throw new MessageException("系统错误,生成验证码失败!");
            }
        }