<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Route; use ModStart\ModStart; 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'), 'login_quick', 'AuthController@loginQuick'); $router->match(array('get'), 'logout', 'AuthController@logout'); $router->match(array('get'), 'login/captcha', 'AuthController@loginCaptcha'); $router->match(array('get'), 'sso/client', 'AuthController@ssoClient'); $router->match(array('get'), 'sso/server', 'AuthController@ssoServer'); $router->match(array('get'), 'sso/server_success', 'AuthController@ssoServerSuccess'); $router->match(array('get'), 'sso/server_logout', 'AuthController@ssoServerLogout'); $router->match(array('post'), 'util/frame', 'UtilController@frame'); $router->match(array('get'), 'util/switch_lang', 'UtilController@switchLang'); $router->match(array('post'), 'system/clear_cache', 'SystemController@clearCache'); $router->match(array('get', 'post'), 'system/security_fix', 'SystemController@securityFix'); $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('post'), 'admin_role/delete', 'AdminRoleController@delete'); $router->match(array('get'), '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('post'), 'admin_user/delete', 'AdminUserController@delete'); $router->match(array('get'), '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'), 'admin_log/show', 'AdminLogController@show'); $router->match(array('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 qtEW3; qtEW3: $XgbS2 = ModuleManager::listAllInstalledModulesInRequiredOrder(); goto JTVqX; JTVqX: $Kxp3W = array(); goto VXkIo; dG5hp: return $Kxp3W; goto WY7_W; VXkIo: foreach ($XgbS2 as $JHuzz) { if (file_exists($WF06r = ModuleManager::path($JHuzz, 'Admin/routes.php'))) { $Kxp3W[$JHuzz] = $WF06r; } } goto dG5hp; WY7_W: } public static function registerModuleRoutes() { goto NC7Me; FdXns: if (file_exists($LxgGc = modstart_admin_path('routes.php'))) { require $LxgGc; } goto VIYVU; NC7Me: if (config('env.APP_DEBUG')) { $VBeCb = self::listModuleRoutes(); } else { if (method_exists(ModStart::class, 'cacheKey')) { $VBeCb = Cache::rememberForever(ModStart::cacheKey('ModStartAdminRoutes'), function () { return self::listModuleRoutes(); }); } else { $VBeCb = self::listModuleRoutes(); } } goto R7Jt0; R7Jt0: foreach ($VBeCb as $JHuzz => $WF06r) { Route::group(array('prefix' => config('modstart.admin.prefix'), 'middleware' => array('admin.bootstrap', 'admin.auth'), 'namespace' => "\\Module\\{$JHuzz}\\Admin\\Controller"), function ($router) use($WF06r) { if (file_exists($WF06r)) { require $WF06r; } }); } goto FdXns; VIYVU: } }