mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Guest;
|
|
|
|
use App\Utils\Dict;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
class CommController extends Controller
|
|
{
|
|
public function config()
|
|
{
|
|
return response([
|
|
'data' => [
|
|
'tos_url' => config('v2board.tos_url'),
|
|
'is_email_verify' => (int)config('v2board.email_verify', 0) ? 1 : 0,
|
|
'is_invite_force' => (int)config('v2board.invite_force', 0) ? 1 : 0,
|
|
'email_whitelist_suffix' => (int)config('v2board.email_whitelist_enable', 0)
|
|
? $this->getEmailSuffix()
|
|
: 0,
|
|
'is_recaptcha' => (int)config('v2board.recaptcha_enable', 0) ? 1 : 0,
|
|
'recaptcha_site_key' => config('v2board.recaptcha_site_key'),
|
|
'app_description' => config('v2board.app_description'),
|
|
'app_url' => config('v2board.app_url'),
|
|
'logo' => config('v2board.logo'),
|
|
]
|
|
]);
|
|
}
|
|
|
|
private function getEmailSuffix()
|
|
{
|
|
$suffix = config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT);
|
|
if (!is_array($suffix)) {
|
|
return preg_split('/,/', $suffix);
|
|
}
|
|
return $suffix;
|
|
}
|
|
}
|