mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-10-27 06:57:12 +08:00
fix(system/sms): 修复短信配置加载错误,移除 SmsSupplierEnum
Closes #IC4D7F
This commit is contained in:
@@ -203,16 +203,12 @@ public class CaptchaController {
|
||||
String captcha = RandomUtil.randomNumbers(captchaSms.getLength());
|
||||
// 发送验证码
|
||||
Long expirationInMinutes = captchaSms.getExpirationInMinutes();
|
||||
|
||||
SmsBlend smsBlend = SmsFactory.getBySupplier(captchaSms.getSupplier());
|
||||
|
||||
Map<String, String> messageMap = MapUtil.newHashMap(2, true);
|
||||
messageMap.put(captchaSms.getCodeKey(), captcha);
|
||||
messageMap.put(captchaSms.getTimeKey(), String.valueOf(expirationInMinutes));
|
||||
|
||||
SmsResponse smsResponse = smsBlend.sendMessage(phone, captchaSms
|
||||
.getTemplateId(), (LinkedHashMap<String, String>)messageMap);
|
||||
|
||||
CheckUtils.throwIf(!smsResponse.isSuccess(), "验证码发送失败");
|
||||
// 保存验证码
|
||||
String captchaKey = CacheConstants.CAPTCHA_KEY_PREFIX + phone;
|
||||
|
||||
Reference in New Issue
Block a user