From c7566e77c0d2a6466c4ebffaa231be6674f93e2c Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Tue, 10 Jun 2025 14:09:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B7=BB=E5=8A=A0=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=86=85=E9=A1=B5=E7=B3=BB=E7=BB=9Furls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/v1/System.php | 118 +++++++++++++++++- .../validate/v1/NavigationItemValidate.php | 4 +- .../validate/v1/SysBannerItemValidate.php | 4 +- 3 files changed, 121 insertions(+), 5 deletions(-) diff --git a/app/admin/controller/v1/System.php b/app/admin/controller/v1/System.php index d53350ce..85e461ec 100644 --- a/app/admin/controller/v1/System.php +++ b/app/admin/controller/v1/System.php @@ -8,7 +8,6 @@ use app\admin\model\v1\ArticleModel; use app\admin\model\v1\ProductCategoryModel; use app\admin\model\v1\ProductModel; use think\facade\Db; -use think\facade\Route; class System { @@ -155,6 +154,123 @@ class System 'name' => '产品', 'link_to' => 'product', 'data' => array_to_tree($product_category, 0, 'pid', false, false) + ], + [ + 'name' => '其他内页', + 'link_to' => 'system_page', + 'data' => [ + [ + 'id' => 1, + 'name' => '首页', + 'url' => (string)url('/index/index/index') + ], + [ + 'id' => 2, + 'name' => '新品上市', + 'url' => (string)url('/index/product/newpro') + ], + [ + 'id' => 3, + 'name' => '附件下载', + 'url' => (string)url('/index/attachment/index') + ], + [ + 'id' => 4, + 'name' => '问答中心', + 'url' => (string)url('/index/faq/index') + ], + [ + 'id' => 5, + 'name' => '关于我们', + 'url' => '', + 'children' => [ + [ + 'id' => 51, + 'name' => '品牌介绍', + 'url' => (string)url('/index/aboutus/introduction') + ], + [ + 'id' => 52, + 'name' => '品牌故事', + 'url' => (string)url('/index/aboutus/story') + ], + [ + 'id' => 53, + 'name' => '品牌历程', + 'url' => (string)url('/index/aboutus/mileage') + ], + [ + 'id' => 54, + 'name' => '文化介绍', + 'url' => (string)url('/index/aboutus/culture') + ], + [ + 'id' => 55, + 'name' => '售后政策', + 'url' => (string)url('/index/aboutus/policy') + ] + ] + ], + [ + 'id' => 6, + 'name' => '联系我们', + 'url' => '', + 'children' => [ + [ + 'id' => 61, + 'name' => '联系我们', + 'url' => (string)url('/index/contactus/index') + ], + [ + 'id' => 62, + 'name' => '留言联系我们', + 'url' => (string)url('/index/contactus/message') + ], + [ + 'id' => 63, + 'name' => '留言成为分销商', + 'url' => (string)url('/index/contactus/distributor') + ], + [ + 'id' => 64, + 'name' => '留言批量购买', + 'url' => (string)url('/index/contactus/bulkbuy') + ] + ] + ], + [ + 'id' => 7, + 'name' => 'NAS专题', + 'url' => '', + 'children' => [ + [ + 'id' => 71, + 'name' => '首页', + 'url' => (string)url('/index/topic/nas/index') + ], + [ + 'id' => 72, + 'name' => '产品体验', + 'url' => (string)url('/index/topic/nas/product') + ], + [ + 'id' => 73, + 'name' => '客户合作', + 'url' => (string)url('/index/topic/nas/cooperation') + ], + [ + 'id' => 74, + 'name' => '帮助中心', + 'url' => (string)url('/index/topic/nas/help') + ], + [ + 'id' => 75, + 'name' => '软件下载', + 'url' => (string)url('/index/topic/nas/download') + ] + ] + ] + ], ] ]; diff --git a/app/admin/validate/v1/NavigationItemValidate.php b/app/admin/validate/v1/NavigationItemValidate.php index 94deb29b..70bdae9c 100644 --- a/app/admin/validate/v1/NavigationItemValidate.php +++ b/app/admin/validate/v1/NavigationItemValidate.php @@ -21,7 +21,7 @@ class NavigationItemValidate extends Validate 'pid' => 'integer|different:id|checkPidNotBeChildren', 'name' => 'require|max:64', 'icon' => 'max:64', - 'link_to' => 'require|max:64|in:article,article_category,product,product_category,custom', + 'link_to' => 'require|max:64|in:article,article_category,product,product_category,system_page,custom', 'link' => 'max:255', 'sort' => 'integer', 'blank' => 'in:0,1', @@ -47,7 +47,7 @@ class NavigationItemValidate extends Validate 'icon.max' => '图标最多不能超过64个字符', 'link_to.require' => '链接类型不能为空', 'link_to.max' => '链接类型最多不能超过64个字符', - 'link_to.in' => '链接类型必须是article,goods_category,goods,custom中之一', + 'link_to.in' => '链接类型必须是article,article_category,product_category,product,system_page,custom中之一', 'link.max' => '链接最多不能超过255个字符', 'sort.integer' => '排序必须为整数', 'blank.in' => '是否新窗口打开只能是0或1', diff --git a/app/admin/validate/v1/SysBannerItemValidate.php b/app/admin/validate/v1/SysBannerItemValidate.php index d02b30e7..39b8d285 100644 --- a/app/admin/validate/v1/SysBannerItemValidate.php +++ b/app/admin/validate/v1/SysBannerItemValidate.php @@ -23,7 +23,7 @@ class SysBannerItemValidate extends Validate 'type' => 'in:image,video', 'image' => 'max:255', 'video' => 'max:255', - 'link_to' => 'requireIf:type,image|max:64|in:article,article_category,product,product_category,custom', + 'link_to' => 'requireIf:type,image|max:64|in:article,article_category,product,product_category,system_page,custom', 'link' => 'max:255', 'sort' => 'integer', 'status' => 'in:-1,1' @@ -50,7 +50,7 @@ class SysBannerItemValidate extends Validate 'video.max' => '视频地址最多不能超过255个字符', 'link_to.requireIf' => '链接类型不能为空', 'link_to.max' => '链接类型最多不能超过64个字符', - 'link_to.in' => '链接类型必须是article,article_category,product,product_category,custom中之一', + 'link_to.in' => '链接类型必须是article,article_category,product,product_category,system_page,custom中之一', 'link.max' => '链接最多不能超过255个字符', 'sort.integer' => '排序值必须是整数', 'status.in' => '状态必须是-1或1'