Esempio n. 1
0
        public bool SendCode()
        {
            string smsAccount  = Winner.ConfigurationManager.ConfigurationProvider.GetString(SMS_ACCOUNT_SETTING_NAME);
            string smsPassword = Winner.ConfigurationManager.ConfigurationProvider.GetString(SMS_PWD_SETTING_NAME);
            var    fac         = UserModuleFactory.GetUserModuleInstance();

            this.User = fac?.GetUserByCode(this._userCode);
            if (_validationType == SmsValidateType.注册)
            {
                if (User != null)
                {
                    Alert("手机号已被注册");
                    return(false);
                }
            }
            else if (_validationType == SmsValidateType.重置支付密码 || _validationType == SmsValidateType.重置登录密码)
            {
                if (User == null)
                {
                    Alert("手机号未注册");
                    return(false);
                }
            }
            SmsServiceClient client = new SmsServiceClient(smsAccount, smsPassword);

            if (!client.SendValidateCode(this._userCode, GID, null))
            {
                Alert(client.Message);
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public void ClientProxyTest()
        {
            SmsServiceClient client = new SmsServiceClient("DZR", "123456789_DZR");
            var    res     = client.Send("18675534882", "【253云通讯】欢迎体验253云通讯产品验证码是253253");
            string message = client.Message;

            Assert.IsTrue(res);
        }
Esempio n. 3
0
        public bool VerifyCode(string code)
        {
            SmsServiceClient client = new SmsServiceClient(_sms_account_code, _sms_account_pwd);

            if (!client.ValidateCode(_userCode, GetSmsTemplateGid(_codeType), code))
            {
                Alert(client.Message);
                return(false);
            }
            return(true);
        }
Esempio n. 4
0
        public bool SendCode()
        {
            SmsServiceClient client = new SmsServiceClient(_sms_account_code, _sms_account_pwd);

            if (!client.SendValidateCode(_userCode, GetSmsTemplateGid(_codeType), null))
            {
                Alert(client.Message);
                return(false);
            }
            return(true);
        }
Esempio n. 5
0
        public bool ValidateCode(string code)
        {
            string smsAccount  = Winner.ConfigurationManager.ConfigurationProvider.GetString(SMS_ACCOUNT_SETTING_NAME);
            string smsPassword = Winner.ConfigurationManager.ConfigurationProvider.GetString(SMS_PWD_SETTING_NAME);

            SmsServiceClient client = new SmsServiceClient(smsAccount, smsPassword);

            if (!client.ValidateCode(_userCode, GID, code))
            {
                Alert(client.Message);
                return(false);
            }
            return(true);
        }