fix(system/sms): 修复短信配置加载错误,移除 SmsSupplierEnum

Closes #IC4D7F
This commit is contained in:
2025-04-27 22:08:58 +08:00
parent e4828bf2a3
commit 16cdff753f
7 changed files with 37 additions and 166 deletions

View File

@@ -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;