public async Task <SendSmsCodeOutput> SendSmsCodeAsync([FromBody] SendSmsCodeInput input) { // 短信模板维护 if (input.SmsTemplateName.IsEmpty()) { input.SmsTemplateName = "smscode"; } // 图形验证码验证 var redis = _cachingProviderFactory.GetCachingProvider("default_redis"); var redis_img_code = await redis.GetAsync <string>($"ImgCode:{input.Guid}"); if (redis_img_code.IsEmpty()) { throw new BucketException("GO_2003", "图形验证码已过期"); } if (redis_img_code.SafeString().ToLower() != input.ImgCode.SafeString().ToLower()) { throw new BucketException("GO_2003", "图形验证码错误"); } // 短信发送 var code = await _authService.SendSmsCodeAsync(input.Mobile, input.SmsTemplateName); return(new SendSmsCodeOutput { Message = "发送成功" }); }
/// <summary> /// 发送短信验证码 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <SendSmsCodeOutput> SendSmsCodeAsync(SendSmsCodeInput input) { // 账号判断 // await _authRepository.SendSmsCodeAsync(input.Mobile, input.SmsTemplateName); return(new SendSmsCodeOutput { Message = "发送成功" }); }
/// <summary> /// 发送短信验证码 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <SendSmsCodeOutput> SendSmsCodeAsync(SendSmsCodeInput input) { return(new SendSmsCodeOutput { Message = "发送成功" }); }
public async Task <SendSmsCodeOutput> SendSmsCode([FromBody] SendSmsCodeInput input) { return(await _authBusiness.SendSmsCodeAsync(input)); }