Commit a5fd8743 by 孙龙

跨域

parent f21d71d3
Showing with 5 additions and 2 deletions
...@@ -48,5 +48,7 @@ class Kernel extends HttpKernel ...@@ -48,5 +48,7 @@ class Kernel extends HttpKernel
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'cors' => \App\Http\Middleware\CrossHttp::class,
]; ];
} }
...@@ -28,8 +28,9 @@ Route::pattern('roleId', '[0-9]+'); ...@@ -28,8 +28,9 @@ Route::pattern('roleId', '[0-9]+');
| |
*/ */
Route::get('/api/get_user_labels', 'ApiController@getUserLabels'); Route::group(['middleware' => 'cors'], function () {
Route::get('/api/get_user_labels', 'ApiController@getUserLabels');
});
Route::group(['middleware' => 'web'], function () { Route::group(['middleware' => 'web'], function () {
Route::get('/', 'WebController@index'); Route::get('/', 'WebController@index');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment