<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Route; use ModStart\Module\ModuleManager; class ModStartAdmin { public static function registerAuthRoutes() { Route::group(array('prefix' => config('modstart.admin.prefix'), 'namespace' => '\\ModStart\\Admin\\Controller', 'middleware' => array('admin.bootstrap', 'admin.auth')), function ($router) { $router->match(array('get', 'post'), 'login', 'AuthController@login'); $router->match(array('get', 'post'), 'logout', 'AuthController@logout'); $router->match(array('get', 'post'), 'login/captcha', 'AuthController@loginCaptcha'); $router->match(array('get', 'post'), 'sso/client', 'AuthController@ssoClient'); $router->match(array('get', 'post'), 'sso/server', 'AuthController@ssoServer'); $router->match(array('get', 'post'), 'sso/server_success', 'AuthController@ssoServerSuccess'); $router->match(array('get', 'post'), 'sso/server_logout', 'AuthController@ssoServerLogout'); $router->match(array('get', 'post'), 'util/frame', 'UtilController@frame'); $router->match(array('get', 'post'), 'system/clear_cache', 'SystemController@clearCache'); $router->match(array('get', 'post'), 'system/security_fix', 'SystemController@securityFix'); $router->match(array('get', 'post'), 'module', 'ModuleController@index'); $router->match(array('get', 'post'), 'module/install', 'ModuleController@install'); $router->match(array('get', 'post'), 'module/uninstall', 'ModuleController@uninstall'); $router->match(array('get', 'post'), 'module/refresh', 'ModuleController@refresh'); $router->match(array('get', 'post'), 'module/config', 'ModuleController@config'); $router->match(array('get', 'post'), 'admin_role', 'AdminRoleController@index'); $router->match(array('get', 'post'), 'admin_role/add', 'AdminRoleController@add'); $router->match(array('get', 'post'), 'admin_role/edit', 'AdminRoleController@edit'); $router->match(array('get', 'post'), 'admin_role/delete', 'AdminRoleController@delete'); $router->match(array('get', 'post'), 'admin_role/show', 'AdminRoleController@show'); $router->match(array('get', 'post'), 'admin_user', 'AdminUserController@index'); $router->match(array('get', 'post'), 'admin_user/add', 'AdminUserController@add'); $router->match(array('get', 'post'), 'admin_user/edit', 'AdminUserController@edit'); $router->match(array('get', 'post'), 'admin_user/delete', 'AdminUserController@delete'); $router->match(array('get', 'post'), 'admin_user/show', 'AdminUserController@show'); $router->match(array('get', 'post'), 'profile/change_password', 'ProfileController@changePassword'); $router->match(array('get', 'post'), 'admin_log', 'AdminLogController@index'); $router->match(array('get', 'post'), 'admin_log/show', 'AdminLogController@show'); $router->match(array('get', 'post'), 'admin_log/delete', 'AdminLogController@delete'); $router->match(array('get', 'post'), 'data/file_manager/{category}', 'DataController@fileManager'); $router->match(array('get', 'post'), 'data/ueditor', 'DataController@ueditor'); }); } private static function listModuleRoutes() { goto SjUDS; SjUDS: $lzXUC = ModuleManager::listAllInstalledModules(); goto aR4Qf; G3xIe: foreach ($lzXUC as $l2LYK => $wsDBG) { if (file_exists($oU8qf = ModuleManager::path($l2LYK, 'Admin/routes.php'))) { $nmKJs[$l2LYK] = $oU8qf; } } goto jEeFy; aR4Qf: $nmKJs = array(); goto G3xIe; jEeFy: return $nmKJs; goto H2pIf; H2pIf: } public static function registerModuleRoutes() { goto fpFmX; fpFmX: if (config('env.APP_DEBUG')) { $uEfXk = self::listModuleRoutes(); } else { $uEfXk = Cache::rememberForever('ModStartAdminRoutes', function () { return self::listModuleRoutes(); }); } goto XGDSg; LjoOQ: if (file_exists($LL2ZC = modstart_admin_path('routes.php'))) { require $LL2ZC; } goto bi09N; XGDSg: foreach ($uEfXk as $l2LYK => $oU8qf) { Route::group(array('prefix' => config('modstart.admin.prefix'), 'middleware' => array('admin.bootstrap', 'admin.auth'), 'namespace' => "\\Module\\{$l2LYK}\\Admin\\Controller"), function ($router) use($oU8qf) { require $oU8qf; }); } goto LjoOQ; bi09N: } }