mirror of
https://github.com/v2board/v2board.git
synced 2025-06-14 05:37:49 +08:00
update
This commit is contained in:
@ -13,7 +13,7 @@ class CommController extends Controller
|
||||
{
|
||||
public function isEmailVerify () {
|
||||
return response([
|
||||
'data' => (int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY')) ? 1 : 0
|
||||
'data' => (int)config('v2board.email_verify', 0) ? 1 : 0
|
||||
]);
|
||||
}
|
||||
|
||||
@ -24,12 +24,12 @@ class CommController extends Controller
|
||||
abort(500, '验证码已发送,请过一会在请求');
|
||||
}
|
||||
$code = rand(100000, 999999);
|
||||
$subject = config('v2board.app_name', 'V2Panel') . '邮箱验证码';
|
||||
$subject = config('v2board.app_name', 'V2Board') . '邮箱验证码';
|
||||
Mail::send(
|
||||
'mail.sendEmailVerify',
|
||||
[
|
||||
'code' => $code,
|
||||
'name' => config('v2board.app_name', 'V2Panel')
|
||||
'name' => config('v2board.app_name', 'V2Board')
|
||||
],
|
||||
function ($message) use($email, $subject) {
|
||||
$message->to($email)->subject($subject);
|
||||
|
@ -15,15 +15,15 @@ use App\Models\InviteCode;
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
public function index (RegisterIndex $request) {
|
||||
if ((int)config('v2board.stop_register', env('V2BOARD_STOP_REGISTER'))) {
|
||||
if ((int)config('v2board.stop_register', 0)) {
|
||||
abort(500, '本站已关闭注册');
|
||||
}
|
||||
if ((int)config('v2board.invite_force', env('V2BOARD_INVITE_FOCE'))) {
|
||||
if ((int)config('v2board.invite_force', 0)) {
|
||||
if (empty($request->input('invite_code'))) {
|
||||
abort(500, '必须使用邀请码才可以注册');
|
||||
}
|
||||
}
|
||||
if ((int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY'))) {
|
||||
if ((int)config('v2board.email_verify', 0)) {
|
||||
$redisKey = 'sendEmailVerify:' . $request->input('email');
|
||||
if (empty($request->input('email_code'))) {
|
||||
abort(500, '邮箱验证码不能为空');
|
||||
@ -63,7 +63,7 @@ class RegisterController extends Controller
|
||||
if (!$user->save()) {
|
||||
abort(500, '注册失败');
|
||||
}
|
||||
if ((int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY'))) {
|
||||
if ((int)config('v2board.email_verify', 0)) {
|
||||
Redis::del($redisKey);
|
||||
}
|
||||
return response()->json([
|
||||
|
Reference in New Issue
Block a user