From 99ad98f79bfabd4ed3934cd3d7eba514db7bc10c Mon Sep 17 00:00:00 2001 From: zx <756958008@qq.com> Date: Thu, 28 Jun 2018 12:27:47 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E6=96=B0=E8=B7=AF=E7=94=B1=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84after=5Fbehavior=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminRoute.php | 41 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/application/adminRoute.php b/application/adminRoute.php index 8fa8daa..2b72bb0 100644 --- a/application/adminRoute.php +++ b/application/adminRoute.php @@ -11,27 +11,35 @@ $afterBehavior = [ //一些带有特殊参数的路由写到这里 Route::rule([ - 'admin/Login/index' => [ + 'admin/Login/index' => [ 'admin/Login/index', ['method' => 'post'] ], - 'admin/Index/upload' => [ + 'admin/Index/upload' => [ 'admin/Index/upload', [ - 'method' => 'post', 'after_behavior' => ['\app\admin\behavior\ApiAuth', '\app\admin\behavior\AdminLog'] + 'method' => 'post', + 'after_behavior' => [ + '\app\admin\behavior\ApiAuth', + '\app\admin\behavior\AdminLog' + ] ] ], - 'admin/Login/logout' => [ + 'admin/Login/logout' => [ 'admin/Login/logout', [ - 'method' => 'get', 'after_behavior' => ['\app\admin\behavior\ApiAuth', '\app\admin\behavior\AdminLog'] + 'method' => 'get', + 'after_behavior' => [ + '\app\admin\behavior\ApiAuth', + '\app\admin\behavior\AdminLog' + ] ] ] ]); //大部分控制器的路由都以分组的形式写到这里 -Route::group('admin', function() { +Route::group('admin', function () use ($afterBehavior) { Route::group('Menu', [ 'index' => [ 'admin/Menu/index', @@ -53,7 +61,7 @@ Route::group('admin', function() { 'admin/Menu/del', ['method' => 'get'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('User', [ 'index' => [ 'admin/User/index', @@ -83,7 +91,7 @@ Route::group('admin', function() { 'admin/User/del', ['method' => 'get'] ], - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('Auth', [ 'index' => [ 'admin/Auth/index', @@ -117,7 +125,7 @@ Route::group('admin', function() { 'admin/Auth/getRuleList', ['method' => 'get'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('App', [ 'index' => [ 'admin/App/index', @@ -147,7 +155,7 @@ Route::group('admin', function() { 'admin/App/del', ['method' => 'get'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('InterfaceList', [ 'index' => [ 'admin/InterfaceList/index', @@ -177,7 +185,7 @@ Route::group('admin', function() { 'admin/InterfaceList/getHash', ['method' => 'get'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('Fields', [ 'index' => [ 'admin/Fields/index', @@ -207,7 +215,7 @@ Route::group('admin', function() { 'admin/Fields/upload', ['method' => 'post'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('InterfaceGroup', [ 'index' => [ 'admin/InterfaceGroup/index', @@ -233,7 +241,7 @@ Route::group('admin', function() { 'admin/InterfaceGroup/del', ['method' => 'get'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('AppGroup', [ 'index' => [ 'admin/AppGroup/index', @@ -259,7 +267,7 @@ Route::group('admin', function() { 'admin/AppGroup/del', ['method' => 'get'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::group('Log', [ 'index' => [ 'admin/Log/index', @@ -269,7 +277,6 @@ Route::group('admin', function() { 'admin/Log/del', ['method' => 'get'] ] - ]); + ], ['after_behavior' => $afterBehavior]); Route::miss('admin/Miss/index'); -}, ['after_behavior' => $afterBehavior] -); +});