mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: fix client protocol
This commit is contained in:
parent
bd0834bd3f
commit
fae48e2c81
@ -50,6 +50,9 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public function render($request, Throwable $exception)
|
||||
{
|
||||
if ($exception instanceof \Facade\Ignition\Exceptions\ViewException) {
|
||||
abort(501, '主题初始化发生错误,请在后台对主题检查或配置后重试。');
|
||||
}
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ class Clash
|
||||
if ($server['networkSettings']) {
|
||||
$grpcSettings = $server['networkSettings'];
|
||||
$array['grpc-opts'] = [];
|
||||
$array['grpc-opts']['grpc-service-name'] = $grpcSettings['serviceName'];
|
||||
if (isset($grpcSettings['serviceName'])) $array['grpc-opts']['grpc-service-name'] = $grpcSettings['serviceName'];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ class Stash
|
||||
if ($server['networkSettings']) {
|
||||
$grpcSettings = $server['networkSettings'];
|
||||
$array['grpc-opts'] = [];
|
||||
$array['grpc-opts']['grpc-service-name'] = $grpcSettings['serviceName'];
|
||||
if (isset($grpcSettings['serviceName'])) $array['grpc-opts']['grpc-service-name'] = $grpcSettings['serviceName'];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,20 +14,24 @@ use Illuminate\Http\Request;
|
||||
*/
|
||||
|
||||
Route::get('/', function (Request $request) {
|
||||
if (config('v2board.app_url') && config('v2board.safe_mode_enable', 0)) {
|
||||
if ($request->server('HTTP_HOST') !== parse_url(config('v2board.app_url'))['host']) {
|
||||
abort(403);
|
||||
try {
|
||||
if (config('v2board.app_url') && config('v2board.safe_mode_enable', 0)) {
|
||||
if ($request->server('HTTP_HOST') !== parse_url(config('v2board.app_url'))['host']) {
|
||||
abort(403);
|
||||
}
|
||||
}
|
||||
$renderParams = [
|
||||
'title' => config('v2board.app_name', 'V2Board'),
|
||||
'theme' => config('v2board.frontend_theme', 'v2board'),
|
||||
'theme_path' => '/theme/' . config('v2board.frontend_theme', 'v2board') . '/assets/',
|
||||
'version' => config('app.version'),
|
||||
'description' => config('v2board.app_description', 'V2Board is best')
|
||||
];
|
||||
$renderParams['theme_config'] = config('theme.' . config('v2board.frontend_theme', 'v2board'));
|
||||
return view('theme::' . config('v2board.frontend_theme', 'v2board') . '.dashboard', $renderParams);
|
||||
} catch (\Illuminate\Foundation\Bootstrap\HandleExceptions $e) {
|
||||
abort(500, '主题初始化发生错误,请在后台对主题检查或配置后重试。');
|
||||
}
|
||||
$renderParams = [
|
||||
'title' => config('v2board.app_name', 'V2Board'),
|
||||
'theme' => config('v2board.frontend_theme', 'v2board'),
|
||||
'theme_path' => '/theme/' . config('v2board.frontend_theme', 'v2board') . '/assets/',
|
||||
'version' => config('app.version'),
|
||||
'description' => config('v2board.app_description', 'V2Board is best')
|
||||
];
|
||||
$renderParams['theme_config'] = config('theme.' . config('v2board.frontend_theme', 'v2board'));
|
||||
return view('theme::' . config('v2board.frontend_theme', 'v2board') . '.dashboard', $renderParams);
|
||||
});
|
||||
|
||||
Route::get('/' . config('v2board.frontend_admin_path', 'admin'), function () {
|
||||
|
Loading…
Reference in New Issue
Block a user