where('slug', $slug); // }) // ->where('dist_id', getDistId()) // ->first(); // // if ($categoryId) { // $productController = new ProductController(); // return $productController->category($slug); // } else { // $page = SitePage::where('status', '1')->where('dist_id', getDistId())->where('slug', $slug)->first(); // if ($page) { //// $pageController = new PageController(); //// return $pageController->detail($page); // return Route::get('/{slug}', [PageController::class, 'detail'])->name('page.detail'); // } // } // }); // Route::get('/produto/{slug}', function ($slug) { // $productController = new ProductController(); // return $productController->detail($slug); // }); //} Route::get('/demo', [DemoController::class, 'index'])->name('demo'); // 主页 Route::get('/', [HomeController::class, 'index'])->name('home'); // 产品路由 Route::prefix('products')->group(function () { Route::get('/', [ProductController::class, 'index'])->name('products.index'); Route::get('/{id}', [ProductController::class, 'detail'])->name('products.detail'); Route::get('/categories/{categoryId}', [ProductController::class, 'category'])->name('products.category'); }); // 视频路由 Route::prefix('videos')->group(function () { Route::get('/', [VideoController::class, 'index'])->name('videos.index'); Route::get('/{id}', [VideoController::class, 'detail'])->name('videos.detail'); Route::get('/categories/{categoryId}', [VideoController::class, 'category'])->name('videos.category'); }); // 文章路由 Route::prefix('pages')->group(function () { Route::get('/', [PageController::class, 'list'])->name('page.list'); // 页面列表页 Route::get('/{slug}', [PageController::class, 'detail'])->name('page.detail'); // 页面详情页 }); ////专题路由,于用文章 //Route::get('/collections/{slug}', [CollectionController::class, 'show'])->name('collections.show'); // // 询盘路由 Route::prefix('contact')->group(function () { Route::get('/', [ContactController::class, 'create'])->name('contact.create'); Route::post('/', [ContactController::class, 'store'])->name('contact.store'); }); Route::prefix('collections')->group(function () { Route::get('/{slug}', [CollectionController::class, 'detail'])->name('collection.detail'); }); // Sitemap 路由 Route::get('/sitemap.xml', [SitemapController::class, 'index'])->name('sitemap.index');