fix: send verification SMS synchronously

This commit is contained in:
danaisuiyuan
2026-05-20 20:44:52 +08:00
parent f4e8dab88a
commit ab65147b82
2 changed files with 8 additions and 4 deletions

View File

@@ -35,11 +35,13 @@ class SmsSendServices extends BaseServices
$services = app()->make(ServeServices::class);
$type = $this->smsType[sys_config('sms_type', 0)];
$templateMark = strtolower($template);
//获取短信ID
$templateId = CacheService::handler('TEMPLATE')->remember('NOTICE_SMS_' . $type . '_' . $template, function () use ($services, $template) {
$templateId = CacheService::handler('TEMPLATE')->remember('NOTICE_SMS_' . $type . '_' . $templateMark, function () use ($template, $templateMark) {
/** @var SystemNotificationServices $notifyServices */
$notifyServices = app()->make(SystemNotificationServices::class);
return $notifyServices->value(['mark' => $template], 'sms_id') ?? 0;
return $notifyServices->value(['mark' => $template], 'sms_id')
?: ($templateMark === $template ? 0 : ($notifyServices->value(['mark' => $templateMark], 'sms_id') ?? 0));
});
//获取发送短信驱动类型
$smsMake = $services->sms($type);