fix:修复BUG/升级1.1.6版本

This commit is contained in:
Ying
2023-04-25 20:11:49 +08:00
parent 445e5f9662
commit 6a6866bbaf
2357 changed files with 456920 additions and 140567 deletions

View File

@@ -59,14 +59,21 @@ Route::any('/static/system/js/plugin.js', function () {
* @var array $response
*/
Route::fallback(function ($request) {
$pathInfo = parse_url(request()->url());
if (!isset($pathInfo['path'])) {
$parseApp = ['index'];
} elseif ($pathInfo['path'] == '/') {
// 默认应用路由
return redirect('/index');
} else {
$parseApp = explode('/', ltrim($pathInfo['path'], '/'));
}
// 判断是否为API接口
if ($request->expectsJson()) {
return json(['code' => 404, 'msg' => '404 not found']);
}
return response(request_error(current($parseApp)), 404);
});