Commit 3dfc7e6b by 叶明星

优化路由

parent 9fd8976f
Showing with 7 additions and 13 deletions
......@@ -11,16 +11,9 @@
|
*/
$app->get('/', function () use ($app) {
return $app->version();
});
$app->group(['middleware' => 'login','namespace'=>'App\Http\Controllers'], function () use ($app) {
$app->get('/',function ()use($app){
$app->get('/',function ()use($app){
return $app->version();
});
$app->get('/test/index','ExampleController@index');
});
$app->get('/test/index','ExampleController@index');
......@@ -66,12 +66,13 @@ $app->singleton(
$app->middleware([
// App\Http\Middleware\ExampleMiddleware::class
App\Http\Middleware\UniqueMiddleware::class,
App\Http\Middleware\CheckLogin::class
]);
$app->routeMiddleware([
// 'auth' => App\Http\Middleware\Authenticate::class,
'login' => App\Http\Middleware\CheckLogin::class
]);
// $app->routeMiddleware([
//// 'auth' => App\Http\Middleware\Authenticate::class,
// 'login' => App\Http\Middleware\CheckLogin::class
// ]);
/*
|--------------------------------------------------------------------------
......
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