ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ <?php use Illuminate\Support\Facades\Route; use App\Http\Controllers\Admin\{ LoginController, IndexController, PowerController, AdminController, RoleController, WebconfigController, ParamController, UploadController, OperationlogController, CityController }; function common_route_list(){ Route::get('/index', 'index')->name('index'); Route::get('/create', 'create')->name('create'); Route::post('/store', 'store')->name('store'); Route::post('/del', 'del')->name('del'); Route::get('/edit/{id?}', 'edit')->name('edit'); Route::post('/update/{id}', 'update')->name('update'); Route::post('/update_field', 'update_field')->name('update_field'); } /* |-------------------------------------------------------------------------- | Admin Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider and all of them will | be assigned to the "web" middleware group. Make something great! | */ Route::get('/', function (){ return redirect(route('admin.index.layout')); }); /*登录*/ Route::controller(LoginController::class)->group(function (){ Route::get('/login', 'login')->name('login'); Route::post('/login_post', 'login_post')->name('login_post'); Route::get('/logout', 'logout')->name('logout'); }); /*登录才可以进入*/ Route::middleware('check.auth')->group(function (){ /*IndexController*/ Route::group(['prefix' => '/index', 'as' => 'index.', 'controller' => IndexController::class], function (){ Route::get('/console', 'console')->name('console'); Route::get('/layout', 'layout')->name('layout'); Route::get('/index', 'index')->name('index'); }); /*PowerController 权限管理*/ Route::group(['prefix' => '/power', 'as' => 'power.', 'controller' => PowerController::class], function (){ Route::post('/menu_json', 'menu_json')->name('menu_json'); Route::get('/all_url', 'all_url')->name('all_url'); common_route_list(); }); /*AdminController 管理员管理*/ Route::group(['prefix' => '/admin', 'as' => 'admin.', 'controller' => AdminController::class], function (){ common_route_list(); Route::get('/login_list', 'login_list')->name('login_list'); }); /*RoleController 角色管理*/ Route::group(['prefix' => '/role', 'as' => 'role.', 'controller' => RoleController::class], function (){ common_route_list(); }); /*WebconfigController 站点设置*/ Route::group(['prefix' => '/config', 'as' => 'config.', 'controller' => WebconfigController::class], function (){ common_route_list(); Route::post('/auto_store', 'auto_store')->name('auto_store'); Route::post('/auto_update/{id}', 'auto_update')->name('auto_update'); }); /*ParamController 参数-分类管理*/ Route::group(['prefix' => '/param', 'as' => 'param.', 'controller' => ParamController::class], function (){ common_route_list(); Route::get('/create_all', 'create_all')->name('create_all'); Route::post('/create_all_store', 'create_all_store')->name('create_all_store'); }); /*UploadController 文件上传*/ Route::group(['prefix' => '/upload', 'as' => 'upload.', 'controller' => UploadController::class], function (){ Route::post('/upload', 'upload')->name('upload'); }); /*OperationlogController 操作日志*/ Route::group(['prefix' => '/log', 'as' => 'log.', 'controller' => OperationlogController::class], function (){ common_route_list(); Route::post('/del_all', 'del_all')->name('del_all'); }); /*CityController 行政区域*/ Route::group(['prefix' => '/city', 'as' => 'city.', 'controller' => CityController::class], function (){ common_route_list(); }); }); /* |********************************************** | 其他方法名称随便 | 保存和增加方法名称必须包含 update,store |********************************************* */ ~~~