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,22 +39,26 @@ 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 () {
->middleware('api') Route::prefix(config('endpoint.api.path'))
->namespace($this->namespace) ->middleware('api')
->group(app_path('Endpoint/Api/routes.php')); ->namespace($this->namespace)
->group(app_path('Endpoint/Api/routes.php'));
Route::prefix('callback') Route::prefix('callback')
->namespace($this->namespace) ->namespace($this->namespace)
->group(app_path('Endpoint/Callback/routes.php')); ->group(app_path('Endpoint/Callback/routes.php'));
Route::prefix('h5') Route::prefix('h5')
->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',
]);
});
});
}); });
} }