From 25c0a1d94b25a895aec95a612bd2943660d6ba8c Mon Sep 17 00:00:00 2001 From: unset Date: Thu, 7 Jun 2018 18:44:04 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=95=88=E7=8E=87=EF=BC=9A=E7=94=B1=E4=BA=8E=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=9A=84=E6=80=A7=E8=83=BD=E6=AF=94=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E9=85=8D=E7=BD=AE=E8=A6=81=E9=AB=98=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=EF=BC=8C=E5=B0=A4=E5=85=B6=E6=98=AF=E5=A4=9A=E7=A7=8D=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E7=B1=BB=E5=9E=8B=E6=B7=B7=E5=90=88=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E3=80=82=E8=B7=AF=E7=94=B1=E5=88=86?= =?UTF-8?q?=E7=BB=84=E5=8A=9F=E8=83=BD=E5=85=81=E8=AE=B8=E6=8A=8A=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E5=89=8D=E7=BC=80=E7=9A=84=E8=B7=AF=E7=94=B1=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=90=88=E5=B9=B6=E5=88=86=E7=BB=84=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E6=A0=B7=E5=8F=AF=E4=BB=A5=E6=8F=90=E9=AB=98=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E7=9A=84=E6=95=88=E7=8E=87=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E6=AF=8F=E6=AC=A1=E9=83=BD=E5=8E=BB=E9=81=8D=E5=8E=86?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E7=9A=84=E8=B7=AF=E7=94=B1=E8=A7=84=E5=88=99?= =?UTF-8?q?=E3=80=82=202=E3=80=81=E9=85=8D=E7=BD=AE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9B=B4=E5=8A=A0=E6=98=8E=E4=BA=86=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminRoute.php | 494 ++++++++++++++++++++----------------- 1 file changed, 262 insertions(+), 232 deletions(-) diff --git a/application/adminRoute.php b/application/adminRoute.php index d3d5f10..38140cd 100644 --- a/application/adminRoute.php +++ b/application/adminRoute.php @@ -1,240 +1,270 @@ [ - 'Login/index' => [ - 'admin/Login/index', - ['method' => 'post'] - ], - 'Index/upload' => [ - 'admin/Index/upload', - ['method' => 'post', 'after_behavior' => ['\app\admin\behavior\ApiAuth', '\app\admin\behavior\AdminLog']] - ], - 'Login/logout' => [ - 'admin/Login/logout', - ['method' => 'get', 'after_behavior' => ['\app\admin\behavior\ApiAuth', '\app\admin\behavior\AdminLog']] - ], - 'Menu/index' => [ - 'admin/Menu/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Menu/changeStatus' => [ - 'admin/Menu/changeStatus', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Menu/add' => [ - 'admin/Menu/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'Menu/edit' => [ - 'admin/Menu/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'Menu/del' => [ - 'admin/Menu/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'User/index' => [ - 'admin/User/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'User/getUsers' => [ - 'admin/User/getUsers', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'User/changeStatus' => [ - 'admin/User/changeStatus', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'User/add' => [ - 'admin/User/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'User/own' => [ - 'admin/User/own', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'User/edit' => [ - 'admin/User/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'User/del' => [ - 'admin/User/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Auth/index' => [ - 'admin/Auth/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Auth/changeStatus' => [ - 'admin/Auth/changeStatus', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Auth/delMember' => [ - 'admin/Auth/delMember', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Auth/add' => [ - 'admin/Auth/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'Auth/edit' => [ - 'admin/Auth/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'Auth/del' => [ - 'admin/Auth/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Auth/getGroups' => [ - 'admin/Auth/getGroups', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Auth/getRuleList' => [ - 'admin/Auth/getRuleList', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'App/index' => [ - 'admin/App/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'App/changeStatus' => [ - 'admin/App/changeStatus', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'App/getAppInfo' => [ - 'admin/App/getAppInfo', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'App/add' => [ - 'admin/App/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'App/edit' => [ - 'admin/App/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'App/del' => [ - 'admin/App/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceList/index' => [ - 'admin/InterfaceList/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceList/refresh' => [ - 'admin/InterfaceList/refresh', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceList/changeStatus' => [ - 'admin/InterfaceList/changeStatus', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceList/getHash' => [ - 'admin/InterfaceList/getHash', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceList/add' => [ - 'admin/InterfaceList/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'InterfaceList/edit' => [ - 'admin/InterfaceList/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'InterfaceList/del' => [ - 'admin/InterfaceList/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Fields/index' => [ - 'admin/Fields/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Fields/request' => [ - 'admin/Fields/request', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Fields/response' => [ - 'admin/Fields/response', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Fields/add' => [ - 'admin/Fields/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'Fields/upload' => [ - 'admin/Fields/upload', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'Fields/edit' => [ - 'admin/Fields/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'Fields/del' => [ - 'admin/Fields/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceGroup/index' => [ - 'admin/InterfaceGroup/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceGroup/add' => [ - 'admin/InterfaceGroup/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'InterfaceGroup/edit' => [ - 'admin/InterfaceGroup/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'InterfaceGroup/del' => [ - 'admin/InterfaceGroup/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceGroup/getAll' => [ - 'admin/InterfaceGroup/getAll', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'InterfaceGroup/changeStatus' => [ - 'admin/InterfaceGroup/changeStatus', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'AppGroup/index' => [ - 'admin/AppGroup/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'AppGroup/add' => [ - 'admin/AppGroup/add', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'AppGroup/edit' => [ - 'admin/AppGroup/edit', - ['method' => 'post', 'after_behavior' => $afterBehavior] - ], - 'AppGroup/del' => [ - 'admin/AppGroup/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'AppGroup/getAll' => [ - 'admin/AppGroup/getAll', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'AppGroup/changeStatus' => [ - 'admin/AppGroup/changeStatus', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Log/index' => [ - 'admin/Log/index', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - 'Log/del' => [ - 'admin/Log/del', - ['method' => 'get', 'after_behavior' => $afterBehavior] - ], - '__miss__' => ['admin/Miss/index'], + +//一些带有特殊参数的路由写到这里 +Route::rule([ + 'admin/Login/index' => [ + 'admin/Login/index', + ['method'=>'post'] ], -]; + 'admin/Index/upload' => [ + 'admin/Index/upload', + [ + 'method' => 'post', 'after_behavior' => ['\app\admin\behavior\ApiAuth', '\app\admin\behavior\AdminLog'] + ] + ], + 'admin/Login/logout' => [ + 'admin/Login/logout', + [ + 'method' => 'get', 'after_behavior' => ['\app\admin\behavior\ApiAuth', '\app\admin\behavior\AdminLog'] + ] + ] +]); + + +//大部分控制器的路由都以分组的形式写到这里 +Route::group('admin',function(){ + Route::group('Menu',[ + 'index'=> [ + 'admin/Menu/index', + ['method' => 'get'] + ], + 'changeStatus' =>[ + 'admin/Menu/changeStatus', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/Menu/add', + ['method' => 'post'] + ], + 'edit' =>[ + 'admin/Menu/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/Menu/del', + ['method' => 'get'] + ] + ]); + Route::group('User',[ + 'index'=> [ + 'admin/User/index', + ['method' => 'get'] + ], + 'getUsers' =>[ + 'admin/User/getUsers', + ['method' => 'get'] + ], + 'changeStatus' =>[ + 'admin/User/changeStatus', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/User/add', + ['method' => 'post'] + ], + 'own' =>[ + 'admin/User/own', + ['method' => 'post'] + ], + 'edit' =>[ + 'admin/User/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/User/del', + ['method' => 'get'] + ], + ]); + Route::group('Auth',[ + 'index'=> [ + 'admin/Auth/index', + ['method' => 'get'] + ], + 'changeStatus' =>[ + 'admin/Auth/changeStatus', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/Auth/add', + ['method' => 'post'] + ], + 'delMember' =>[ + 'admin/Auth/delMember', + ['method' => 'get'] + ], + 'edit' =>[ + 'admin/Auth/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/Auth/del', + ['method' => 'get'] + ], + 'getGroups' =>[ + 'admin/Auth/getGroups', + ['method' => 'get'] + ], + 'getRuleList' =>[ + 'admin/Auth/getRuleList', + ['method' => 'get'] + ] + ]); + Route::group('App',[ + 'index'=> [ + 'admin/App/index', + ['method' => 'get'] + ], + 'changeStatus' =>[ + 'admin/App/changeStatus', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/App/add', + ['method' => 'post'] + ], + 'getAppInfo' =>[ + 'admin/App/getAppInfo', + ['method' => 'get'] + ], + 'edit' =>[ + 'admin/App/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/App/del', + ['method' => 'get'] + ] + ]); + Route::group('InterfaceList',[ + 'index'=> [ + 'admin/InterfaceList/index', + ['method' => 'get'] + ], + 'changeStatus' =>[ + 'admin/InterfaceList/changeStatus', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/InterfaceList/add', + ['method' => 'post'] + ], + 'refresh' =>[ + 'admin/InterfaceList/refresh', + ['method' => 'get'] + ], + 'edit' =>[ + 'admin/InterfaceList/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/InterfaceList/del', + ['method' => 'get'] + ], + 'getHash' =>[ + 'admin/InterfaceList/getHash', + ['method' => 'get'] + ] + ]); + Route::group('Fields',[ + 'index'=> [ + 'admin/Fields/index', + ['method' => 'get'] + ], + 'request' =>[ + 'admin/Fields/request', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/Fields/add', + ['method' => 'post'] + ], + 'response' =>[ + 'admin/Fields/response', + ['method' => 'get'] + ], + 'edit' =>[ + 'admin/Fields/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/Fields/del', + ['method' => 'get'] + ], + 'upload' =>[ + 'admin/Fields/upload', + ['method' => 'post'] + ] + ]); + Route::group('InterfaceGroup',[ + 'index'=> [ + 'admin/InterfaceGroup/index', + ['method' => 'get'] + ], + 'getAll' =>[ + 'admin/InterfaceGroup/getAll', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/InterfaceGroup/add', + ['method' => 'post'] + ], + 'changeStatus' =>[ + 'admin/InterfaceGroup/changeStatus', + ['method' => 'get'] + ], + 'edit' =>[ + 'admin/InterfaceGroup/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/InterfaceGroup/del', + ['method' => 'get'] + ] + ]); + Route::group('AppGroup',[ + 'index'=> [ + 'admin/AppGroup/index', + ['method' => 'get'] + ], + 'getAll' =>[ + 'admin/AppGroup/getAll', + ['method' => 'get'] + ], + 'add' =>[ + 'admin/AppGroup/add', + ['method' => 'post'] + ], + 'changeStatus' =>[ + 'admin/AppGroup/changeStatus', + ['method' => 'get'] + ], + 'edit' =>[ + 'admin/AppGroup/edit', + ['method' => 'post'] + ], + 'del' =>[ + 'admin/AppGroup/del', + ['method' => 'get'] + ] + ]); + Route::group('Log',[ + 'index'=> [ + 'admin/Log/index', + ['method' => 'get'] + ], + 'del' =>[ + 'admin/Log/del', + ['method' => 'get'] + ] + ]); + Route::miss('admin/Miss/index'); + },['after_behavior' => $afterBehavior] +); \ No newline at end of file