mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
fix rendering HttpException with whoops
This commit is contained in:
parent
1798d07210
commit
9290f1d2a7
@ -47,6 +47,11 @@ class Handler extends ExceptionHandler
|
||||
}
|
||||
|
||||
if (config('app.debug')) {
|
||||
foreach ($this->dontReport as $type) {
|
||||
if ($e instanceof $type) {
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
}
|
||||
return $this->renderExceptionWithWhoops($e);
|
||||
}
|
||||
|
||||
|
@ -14,15 +14,9 @@ class CheckPlayerExistMiddleware
|
||||
preg_match('/\/([^\/]*)\.png/', $request->getUri(), $matches);
|
||||
}
|
||||
|
||||
$player_name = $matches[1];
|
||||
$player_name = urldecode($matches[1]);
|
||||
|
||||
if (\Option::get('allow_chinese_playername')) {
|
||||
$player_name = urldecode($player_name);
|
||||
// quick fix of chinese playername route parameter problem
|
||||
$GLOBALS['player_name'] = $player_name;
|
||||
}
|
||||
|
||||
if (!PlayerModel::where('player_name', $player_name)->count()) {
|
||||
if (PlayerModel::where('player_name', $player_name)->get()->isEmpty()) {
|
||||
\Http::abort(404, '角色不存在');
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ Route::group(['middleware' => 'App\Http\Middleware\CheckPlayer
|
||||
{
|
||||
// Json profile
|
||||
Route::get('/{player_name}.json', 'TextureController@json');
|
||||
Route::get('/{api}/{player_name}.json', 'TextureController@jsonWithApi');
|
||||
Route::get('/{api}/{player_name}.json', 'TextureController@jsonWithApi')->where('api', 'usm|csl');
|
||||
// Legacy links
|
||||
Route::get('/skin/{player_name}.png', 'TextureController@skin');
|
||||
Route::get('/cape/{player_name}.png', 'TextureController@cape');
|
||||
|
@ -5,5 +5,5 @@
|
||||
@section('content')
|
||||
<h1>404 Not Found</h1>
|
||||
|
||||
<p>详细信息:{{ $message or "Nothing lives here.." }}</p>
|
||||
<p>详细信息:{{ $message or "这里啥都没有哦" }}</p>
|
||||
@endsection
|
||||
|
Loading…
Reference in New Issue
Block a user