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('DEFAULT_EMAIL_VERIFY')) ? 1 : 0
|
||||
'data' => (int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY')) ? 1 : 0
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -15,15 +15,15 @@ use App\Models\InviteCode;
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
public function index (RegisterIndex $request) {
|
||||
if ((int)config('v2board.stop_register', env('DEFAULT_STOP_REGISTER'))) {
|
||||
if ((int)config('v2board.stop_register', env('V2BOARD_STOP_REGISTER'))) {
|
||||
abort(500, '本站已关闭注册');
|
||||
}
|
||||
if ((int)config('v2board.invite_force', env('DEFAULT_INVITE_FOCE'))) {
|
||||
if ((int)config('v2board.invite_force', env('V2BOARD_INVITE_FOCE'))) {
|
||||
if (empty($request->input('invite_code'))) {
|
||||
abort(500, '必须使用邀请码才可以注册');
|
||||
}
|
||||
}
|
||||
if ((int)config('v2board.email_verify', env('DEFAULT_EMAIL_VERIFY'))) {
|
||||
if ((int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY'))) {
|
||||
$redisKey = 'sendEmailVerify:' . $request->input('email');
|
||||
if (empty($request->input('email_code'))) {
|
||||
abort(500, '邮箱验证码不能为空');
|
||||
@ -49,12 +49,12 @@ class RegisterController extends Controller
|
||||
->where('status', 0)
|
||||
->first();
|
||||
if (!$inviteCode) {
|
||||
if ((int)config('v2board.invite_force', env('DEFAULT_INVITE_FOCE'))) {
|
||||
if ((int)config('v2board.invite_force', env('V2BOARD_INVITE_FOCE'))) {
|
||||
abort(500, '邀请码无效');
|
||||
}
|
||||
}
|
||||
$user->invite_user_id = $inviteCode->user_id ? $inviteCode->user_id : null;
|
||||
if (!(int)config('v2board.invite_never_expire', env('DEFAULT_INVITE_NEVER_EXPIRE'))) {
|
||||
if (!(int)config('v2board.invite_never_expire', env('V2BOARD_INVITE_NEVER_EXPIRE'))) {
|
||||
$inviteCode->status = 1;
|
||||
$inviteCode->save();
|
||||
}
|
||||
@ -63,7 +63,7 @@ class RegisterController extends Controller
|
||||
if (!$user->save()) {
|
||||
abort(500, '注册失败');
|
||||
}
|
||||
if ((int)config('v2board.email_verify', env('DEFAULT_EMAIL_VERIFY'))) {
|
||||
if ((int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY'))) {
|
||||
Redis::del($redisKey);
|
||||
}
|
||||
return response()->json([
|
||||
|
Reference in New Issue
Block a user