Browse Source

add cors middleware

pull/3/head
Yusuf 2 years ago
parent
commit
96ec1c8d45
  1. 1
      bootstrap/app.php
  2. 2
      routes/web.php

1
bootstrap/app.php

@ -84,6 +84,7 @@ $app->middleware([
$app->routeMiddleware([ $app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class, 'auth' => App\Http\Middleware\Authenticate::class,
'cors' => App\Http\Middleware\CorsMiddleware::class
]); ]);
/* /*

2
routes/web.php

@ -21,7 +21,7 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->post('/role-menu/search', 'RoleMenuController@search'); $router->post('/role-menu/search', 'RoleMenuController@search');
$router->get('/role-menu/get-role/{id}', 'RoleMenuController@listMenu'); $router->get('/role-menu/get-role/{id}', 'RoleMenuController@listMenu');
$router->group(['middleware' => 'auth'], function () use ($router) { $router->group(['middleware' => ['auth', 'cors']], function () use ($router) {
$router->post('/role/search', 'RoleController@search'); $router->post('/role/search', 'RoleController@search');
$router->post('/role/add', 'RoleController@add'); $router->post('/role/add', 'RoleController@add');

Loading…
Cancel
Save