6
0
Fork 0

路由优化

release
李静 2022-01-06 10:10:29 +08:00
parent 57b9163956
commit fd2c42346f
1 changed files with 17 additions and 13 deletions

View File

@ -39,7 +39,8 @@ class RouteServiceProvider extends ServiceProvider
$this->routes(function () { $this->routes(function () {
Route::domain(config('endpoint.api.domain')) Route::domain(config('endpoint.api.domain'))
->prefix(config('endpoint.api.path')) ->group(function () {
Route::prefix(config('endpoint.api.path'))
->middleware('api') ->middleware('api')
->namespace($this->namespace) ->namespace($this->namespace)
->group(app_path('Endpoint/Api/routes.php')); ->group(app_path('Endpoint/Api/routes.php'));
@ -52,9 +53,12 @@ class RouteServiceProvider extends ServiceProvider
->namespace($this->namespace) ->namespace($this->namespace)
->group(app_path('Endpoint/Wap/routes.php')); ->group(app_path('Endpoint/Wap/routes.php'));
Route::middleware('web') Route::fallback(function () {
->namespace($this->namespace) return response()->json([
->group(base_path('routes/web.php')); 'data' => 'ok',
]);
});
});
}); });
} }