From cf93ef496e7fb3f0e12728e88a91e6dd872da728 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 7 May 2025 10:57:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=B3=BB=E7=BB=9Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/v1/System.php | 9 ++++----- app/index/route/route.php | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/admin/controller/v1/System.php b/app/admin/controller/v1/System.php index fe180fd5..5dabf6a3 100644 --- a/app/admin/controller/v1/System.php +++ b/app/admin/controller/v1/System.php @@ -101,14 +101,14 @@ class System case 'article': $articles = $this->getArticleByCategory($lang_id, $param['id']); $urls = array_map(function($item) { - $item['url'] = (string)url('yy/zz', ['id' => $item['id']]); + $item['url'] = (string)url('/index/article/detail/' . $item['id']); return $item; }, $articles); break; case 'product': $products = $this->getProductByCategory($lang_id, $param['id']); $urls = array_map(function($item) { - $item['url'] = (string)url('yy/zz', ['id' => $item['id']]); + $item['url'] = (string)url('/index/product/detail/' . $item['id']); return $item; }, $products); break; @@ -133,7 +133,7 @@ class System 'name' => '文章分类', 'link_to' => 'article_category', 'data' => array_to_tree(array_map(function($item) { - $item['url'] = (string)url('yy/zz', ['id' => $item['id']]); + $item['url'] = (string)url('/index/article/index/' . $item['id']); return $item; }, $article_category), 0, 'pid', false, false) ], @@ -146,7 +146,7 @@ class System 'name' => '产品分类', 'link_to' => 'product_category', 'data' => array_to_tree(array_map(function($item) { - $item['url'] = (string)url('yy/zz', ['id' => $item['id']]); + $item['url'] = (string)url('/index/product/category/' . $item['id']); return $item; }, $product_category), 0, 'pid', false, false) ], @@ -199,7 +199,6 @@ class System ]) ->language($lang_id) ->category($category_id) - ->enabled() ->select(); return $data->toArray(); diff --git a/app/index/route/route.php b/app/index/route/route.php index 2e9d37bd..3268066a 100644 --- a/app/index/route/route.php +++ b/app/index/route/route.php @@ -13,7 +13,7 @@ use think\facade\Route; Route::get('/', 'Index/index'); // 产品相关路由 -Route::group('product', function() { +Route::group('product', function () { // 产品分类页 Route::get('category/:id', 'Product/category'); // 产品详情页 @@ -27,7 +27,7 @@ Route::group('product', function() { }); // 文章相关路由 -Route::group('article', function() { +Route::group('article', function () { // 文章列表页 Route::get('index/:pid', 'Article/index'); // 文章详情页 @@ -39,21 +39,21 @@ Route::group('article', function() { }); // 附件下载 -Route::group('attachment', function() { +Route::group('attachment', function () { // 软件驱动/手册 - Route::get('index', 'Attachment/index'); - // 视频 - Route::get('video', 'Attachment/video'); + Route::get('index', 'Attachment/index'); + // 视频 + Route::get('video', 'Attachment/video'); }); // 问答中心 -Route::group('faq', function() { +Route::group('faq', function () { // 问答列表页 Route::get('index', 'Faq/index'); }); // 关于我们 -Route::group('aboutus', function() { +Route::group('aboutus', function () { // 品牌介绍 Route::get('introduction', 'AboutUs/introduction'); // 品牌故事 @@ -67,7 +67,7 @@ Route::group('aboutus', function() { }); // 联系我们 -Route::group('contactus', function() { +Route::group('contactus', function () { // 联系我们 Route::get('index', 'ContactUs/index'); // 留言联系我们 @@ -85,9 +85,9 @@ Route::group('contactus', function() { }); // 专题 -Route::group('topic', function() { +Route::group('topic', function () { // 专题-Nas - Route::group('nas', function() { + Route::group('nas', function () { // 专题-Nas首页 Route::get('index', 'TopicNas/index'); // 专题-Nas产品体验页