You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
3.4 KiB
84 lines
3.4 KiB
<?php
|
|
|
|
use App\Admin\Controllers\CouponLogController; // 引入优惠券日志控制器
|
|
use Illuminate\Routing\Router; // 引入路由器类
|
|
|
|
// 注册管理后台的认证路由
|
|
Admin::registerAuthRoutes();
|
|
|
|
// 定义路由组
|
|
Route::group([
|
|
'prefix' => config('admin.route.prefix'), // 路由前缀
|
|
'namespace' => config('admin.route.namespace'), // 控制器命名空间
|
|
'middleware' => config('admin.route.middleware'), // 中间件
|
|
], function (Router $router) {
|
|
|
|
// 设置默认的 404 错误页面
|
|
$router->fallback('HomeController@noFound');
|
|
// 首页路由
|
|
$router->get('/', 'HomeController@index');
|
|
|
|
// 覆盖默认的用户管理路由
|
|
$router->get('auth/users', 'AdminController@index');
|
|
// 覆盖默认的操作日志路由
|
|
$router->get('auth/logs', 'AdminController@indexLogs');
|
|
|
|
// 系统配置相关路由
|
|
$router->resource('settings', 'SettingController')->only('index', 'store');
|
|
|
|
// 商品上架和下架操作
|
|
$router->get('products/{id}/push', 'ProductController@pushProduct');
|
|
|
|
// 分类管理
|
|
// 商品管理
|
|
// 秒杀商品管理
|
|
$router->resource('categories', 'CategoryController'); // 分类资源路由
|
|
$router->resource('products', 'ProductController'); // 商品资源路由
|
|
$router->resource('seckills', 'SeckillController')->only('index', 'create', 'store', 'destroy'); // 秒杀活动的资源路由
|
|
|
|
// 订单发货相关路由
|
|
// 管理员确认订单发货
|
|
$router->post('orders/{order}/ship', 'OrderController@ship');
|
|
// 确认发货状态
|
|
$router->patch('orders/{order}/shipped', 'OrderController@confirmShip');
|
|
|
|
// 退款相关路由
|
|
// 订单相关路由
|
|
// 评论管理路由
|
|
$router->get('orders/{order}/refund', 'OrderController@refund'); // 退款请求
|
|
$router->resource('orders', 'OrderController'); // 订单资源路由
|
|
$router->resource('comments', 'CommentController'); // 评论资源路由
|
|
|
|
// 会员管理相关路由
|
|
$router->resource('users', 'UserController'); // 用户资源路由
|
|
|
|
// 积分日志
|
|
$router->get('score_logs', 'ScoreLogController@index'); // 积分日志查看
|
|
|
|
// 用户购物车数据
|
|
$router->get('cars', 'CarController@index'); // 购物车数据查看
|
|
|
|
// 用户收藏数据
|
|
$router->get('user_like_products', 'ProductLikeController@index'); // 用户收藏的产品
|
|
|
|
// 积分规则和积分等级管理
|
|
$router->resource('score_rules', 'ScoreRuleController'); // 积分规则资源路由
|
|
$router->resource('levels', 'LevelController'); // 积分等级资源路由
|
|
|
|
// 优惠券管理
|
|
$router->resource('coupon_templates', 'CouponTemplateController'); // 优惠券模板资源路由
|
|
// 优惠券日志
|
|
$router->resource('coupon_logs', 'CouponLogController')->only('index'); // 优惠券日志查看
|
|
// 优惠券兑换码管理
|
|
$router->resource('coupon_codes', 'CouponCodeController')->only('index', 'create', 'store', 'destroy'); // 兑换码资源路由
|
|
|
|
// 文章通知管理
|
|
$router->resource('article_notifications', 'ArticleNotificationController')->only('index', 'create', 'store', 'show', 'destroy'); // 文章通知资源路由
|
|
|
|
// 富文本编辑器图片上传
|
|
$router->post('upload/editor', 'UploadController@uploadByEditor'); // 图片上传路由
|
|
|
|
// 通过分类异步加载商品下拉列表
|
|
$router->get('api/products', 'CategoryController@getProducts'); // 获取产品列表的 API 路由
|
|
});
|