mirror of
https://github.com/v2board/v2board.git
synced 2025-01-27 00:19:10 +08:00
update
This commit is contained in:
parent
ef580c94c4
commit
f0b06cda7c
@ -8,7 +8,6 @@ use App\Http\Controllers\Controller;
|
|||||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Illuminate\Support\Facades\Redis;
|
use Illuminate\Support\Facades\Redis;
|
||||||
use App\Jobs\SendEmail;
|
|
||||||
|
|
||||||
class CommController extends Controller
|
class CommController extends Controller
|
||||||
{
|
{
|
||||||
@ -35,15 +34,21 @@ class CommController extends Controller
|
|||||||
}
|
}
|
||||||
$code = rand(100000, 999999);
|
$code = rand(100000, 999999);
|
||||||
$subject = config('v2board.app_name', 'V2Board') . '邮箱验证码';
|
$subject = config('v2board.app_name', 'V2Board') . '邮箱验证码';
|
||||||
$this->dispatch(new SendEmail([
|
Mail::send(
|
||||||
'email' => $email,
|
'mail.sendEmailVerify',
|
||||||
'template_name' => 'mail.sendEmailVerify',
|
[
|
||||||
'template_value' => [
|
'code' => $code,
|
||||||
'code' => $code,
|
'name' => config('v2board.app_name', 'V2Board')
|
||||||
'name' => config('v2board.app_name', 'V2Board')
|
],
|
||||||
],
|
function ($message) use($email, $subject) {
|
||||||
'subject' => $subject
|
$message->to($email)->subject($subject);
|
||||||
]));
|
}
|
||||||
|
);
|
||||||
|
if (count(Mail::failures()) >= 1) {
|
||||||
|
// 发送失败
|
||||||
|
abort(500, '发送失败');
|
||||||
|
}
|
||||||
|
|
||||||
Redis::set($redisKey, $code);
|
Redis::set($redisKey, $code);
|
||||||
Redis::expire($redisKey, 600);
|
Redis::expire($redisKey, 600);
|
||||||
return response([
|
return response([
|
||||||
|
Loading…
Reference in New Issue
Block a user