From 6da08d9d4f4a38f5fca030aef2a272a5ce227ed0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Oct 2026 18:36:27 +0800 Subject: [PATCH] refactor(settings): remove filing info config and readers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the 备案信息 group (icp_filing, police_filing, footer_text) from the global.common PHP/Vue schemas, the FacadeBulk readers and the get_global_settings() payload. No frontend consumer existed. Co-Authored-By: Claude Fable 5 --- assets/admin/src/constants/sections/global.js | 2 +- .../src/schema/sections/global/common.js | 15 +------ src/Admin/Schema/GlobalSchema.php | 5 --- src/Settings/DisplayPageGroups.php | 2 - src/Settings/FacadeBulk.php | 41 ------------------- 5 files changed, 2 insertions(+), 63 deletions(-) diff --git a/assets/admin/src/constants/sections/global.js b/assets/admin/src/constants/sections/global.js index 67478818..c870c984 100644 --- a/assets/admin/src/constants/sections/global.js +++ b/assets/admin/src/constants/sections/global.js @@ -12,7 +12,7 @@ export const globalSection = { label: '常用功能', route: '/global/common', title: '常用功能', - desc: '评论、性能、头像源与备案等全局基础配置。', + desc: '评论、性能、头像源等全局基础配置。', canonicalDomain: 'global', section: 'common', }), diff --git a/assets/admin/src/schema/sections/global/common.js b/assets/admin/src/schema/sections/global/common.js index 79403dbd..5a3636b6 100644 --- a/assets/admin/src/schema/sections/global/common.js +++ b/assets/admin/src/schema/sections/global/common.js @@ -7,7 +7,7 @@ export const commonSchema = { key: 'global.common', title: '常用功能', icon: 'fa fas fa-cog', - description: '管理站点常用开关、懒加载与备案信息等基础配置。', + description: '管理站点图像懒加载等常用基础配置。', defaults: { lazy_posts_thumb: true, lazy_avatar: true, @@ -18,9 +18,6 @@ export const commonSchema = { lazy_other: true, lazy_animation: 'blur', thumbnail: defaultThumbnail, - icp_filing: '', - police_filing: '', - footer_text: '', }, groups: [ { @@ -56,15 +53,5 @@ export const commonSchema = { { key: 'lazy_other', label: '其它图片懒加载', type: 'switch', default: true }, ], }, - { - key: 'filing', - title: '备案信息', - icon: 'fa fas fa-shield-alt', - fields: [ - { key: 'icp_filing', label: 'ICP 备案号', type: 'input', placeholder: '例如:京ICP备12345678号', help: '显示在页脚的备案信息' }, - { key: 'police_filing', label: '公安备案号', type: 'input', placeholder: '例如:公网安备11000000000000号', help: '显示在页脚的备案信息' }, - { key: 'footer_text', label: '页脚附加文字', type: 'input', placeholder: '自定义页脚文字', help: '显示在版权信息下方' }, - ], - }, ], } diff --git a/src/Admin/Schema/GlobalSchema.php b/src/Admin/Schema/GlobalSchema.php index 6073c830..b2912999 100644 --- a/src/Admin/Schema/GlobalSchema.php +++ b/src/Admin/Schema/GlobalSchema.php @@ -35,11 +35,6 @@ class GlobalSchema { ]], ['key' => 'thumbnail', 'label' => '懒加载预载图', 'type' => 'media', 'default' => get_template_directory_uri() . '/assets/img/thumbnail.svg'], ]], - ['key' => 'filing', 'title' => '备案信息', 'fields' => [ - ['key' => 'icp_filing', 'label' => 'ICP 备案号', 'type' => 'input', 'default' => ''], - ['key' => 'police_filing', 'label' => '公安备案号', 'type' => 'input', 'default' => ''], - ['key' => 'footer_text', 'label' => '页脚附加文字', 'type' => 'input', 'default' => ''], - ]], ], ], 'logo' => [ diff --git a/src/Settings/DisplayPageGroups.php b/src/Settings/DisplayPageGroups.php index ea26dc0c..3d26044c 100644 --- a/src/Settings/DisplayPageGroups.php +++ b/src/Settings/DisplayPageGroups.php @@ -154,8 +154,6 @@ trait DisplayPageGroups { 'logo_text' => self::logo_text(), 'logo_width' => self::logo_width(), 'site_favicon' => self::favicon_url(), - 'icp_filing' => self::icp_filing(), - 'footer_text' => self::footer_text(), 'theme_mode' => self::theme_mode(), 'theme_mode_button' => self::get_theme_mode_button_positions(), 'primary_color' => self::primary_color(), diff --git a/src/Settings/FacadeBulk.php b/src/Settings/FacadeBulk.php index 2a57d3df..c8e1942a 100644 --- a/src/Settings/FacadeBulk.php +++ b/src/Settings/FacadeBulk.php @@ -199,47 +199,6 @@ trait FacadeBulk { - /** - * 获取备案配置。 - * @return array {icp_enabled, icp_filing, police_enabled, police_filing} - */ - public static function get_filing_settings(): array { - $s = self::get_all(); - $icp_enabled = !isset($s['footer_icp']) || !empty($s['footer_icp']); - $police_enabled = !isset($s['footer_police']) || !empty($s['footer_police']); - $icp_filing = trim((string) ($s['icp_filing'] ?? '')); - $police_filing = trim((string) ($s['police_filing'] ?? '')); - return [ - 'icp_enabled' => $icp_enabled, - 'icp_filing' => $icp_filing, - 'police_enabled' => $police_enabled, - 'police_filing' => $police_filing, - ]; - } - - - - /** 获取页脚附加文字 */ - public static function footer_text(): string { - return trim((string) self::get_value('footer_text', '')); - } - - - - /** 获取 ICP 备案号 */ - public static function icp_filing(): string { - return trim((string) self::get_value('icp_filing', '')); - } - - - - /** 获取公安备案号 */ - public static function police_filing(): string { - return trim((string) self::get_value('police_filing', '')); - } - - - /** 获取导航 Logo 宽度 */ public static function logo_width(): int { $width = (int) self::get_value('logo_width', 150);