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 () {
Route::domain(config('endpoint.api.domain'))
->prefix(config('endpoint.api.path'))
->middleware('api')
->namespace($this->namespace)
->group(app_path('Endpoint/Api/routes.php'));
->group(function () {
Route::prefix(config('endpoint.api.path'))
->middleware('api')
->namespace($this->namespace)
->group(app_path('Endpoint/Api/routes.php'));
Route::prefix('callback')
->namespace($this->namespace)
->group(app_path('Endpoint/Callback/routes.php'));
Route::prefix('callback')
->namespace($this->namespace)
->group(app_path('Endpoint/Callback/routes.php'));
Route::prefix('h5')
->namespace($this->namespace)
->group(app_path('Endpoint/Wap/routes.php'));
Route::prefix('h5')
->namespace($this->namespace)
->group(app_path('Endpoint/Wap/routes.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Route::fallback(function () {
return response()->json([
'data' => 'ok',
]);
});
});
});
}