From 9bb74e6e6acd2e45fb33a28f767fc70dc7ed16d3 Mon Sep 17 00:00:00 2001 From: linda Date: Thu, 29 Oct 2026 09:49:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E7=B3=BB=E7=BB=9F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD=E6=96=87=E5=8C=96=E4=B8=8E=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 站点名称、版本、分类类型、配置分组、附件分类改为中文 - fa_config 配置项标题/提示/默认值统一中文,修正首页配置乱码 - 语言包禁用长缓存,后台文案调整后立即生效 - 站点版本升至 1.0.2,强制刷新后台 JS/CSS 缓存 --- db/schema_phase10_admin_config_zh.sql | 31 ++++++++++++++++++++ server/application/admin/controller/Ajax.php | 10 +++---- server/application/extra/site.php | 28 +++++++++--------- 3 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 db/schema_phase10_admin_config_zh.sql diff --git a/db/schema_phase10_admin_config_zh.sql b/db/schema_phase10_admin_config_zh.sql new file mode 100644 index 0000000..bf0592f --- /dev/null +++ b/db/schema_phase10_admin_config_zh.sql @@ -0,0 +1,31 @@ +-- ============================================================================ +-- 优匠优服 · Phase 10 后台系统配置中文化 +-- 修正配置项标题/提示/分组/默认值,避免后台配置页出现英文或乱码 +-- ============================================================================ +SET NAMES utf8mb4; + +UPDATE `fa_config` SET `title`='站点名称', `tip`='请填写站点名称', `value`='优匠优服' WHERE `name`='name'; +UPDATE `fa_config` SET `title`='备案号', `tip`='' WHERE `name`='beian'; +UPDATE `fa_config` SET `title`='CDN地址', `tip`='全站静态资源使用第三方云存储时填写' WHERE `name`='cdnurl'; +UPDATE `fa_config` SET `title`='版本号', `tip`='静态资源变动时请更新该值以刷新缓存', `value`='1.0.2' WHERE `name`='version'; +UPDATE `fa_config` SET `title`='时区', `tip`='例如 Asia/Shanghai' WHERE `name`='timezone'; +UPDATE `fa_config` SET `title`='禁止IP', `tip`='一行一条记录' WHERE `name`='forbiddenip'; +UPDATE `fa_config` SET `title`='语言配置', `tip`='后台与前台语言' WHERE `name`='languages'; +UPDATE `fa_config` SET `title`='默认首页', `tip`='请输入左侧菜单栏存在的链接' WHERE `name`='fixedpage'; + +UPDATE `fa_config` SET `title`='首页服务保障', `tip`='英文逗号分隔,展示为保障条' WHERE `name`='home_assure'; +UPDATE `fa_config` SET `title`='首页教程卡', `tip`='格式:标题|副标题' WHERE `name`='home_tutorial'; + +UPDATE `fa_config` SET `title`='分类类型', `tip`='用于分类管理的类型选项', `value`='{"default":"默认","page":"单页","article":"文章","test":"测试"}' WHERE `name`='categorytype'; +UPDATE `fa_config` SET `title`='配置分组', `tip`='系统配置页左侧分组名称', `value`='{"basic":"基础配置","email":"邮箱配置","dictionary":"字典配置","user":"会员配置","example":"示例"}' WHERE `name`='configgroup'; +UPDATE `fa_config` SET `title`='附件分类', `tip`='附件管理中的分类名称', `value`='{"category1":"分类1","category2":"分类2","custom":"自定义"}' WHERE `name`='attachmentcategory'; + +UPDATE `fa_config` SET `title`='邮件发送方式', `tip`='选择邮件发送方式' WHERE `name`='mail_type'; +UPDATE `fa_config` SET `title`='SMTP主机', `tip`='错误的配置发送邮件会导致服务器超时' WHERE `name`='mail_smtp_host'; +UPDATE `fa_config` SET `title`='SMTP端口', `tip`='不加密默认25,SSL默认465,TLS默认587' WHERE `name`='mail_smtp_port'; +UPDATE `fa_config` SET `title`='SMTP用户名', `tip`='填写完整用户名' WHERE `name`='mail_smtp_user'; +UPDATE `fa_config` SET `title`='SMTP密码', `tip`='填写密码或授权码' WHERE `name`='mail_smtp_pass'; +UPDATE `fa_config` SET `title`='SMTP验证方式', `tip`='推荐使用SSL' WHERE `name`='mail_verify_type'; +UPDATE `fa_config` SET `title`='发件人邮箱', `tip`='' WHERE `name`='mail_from'; + +-- 回滚:从备份 fa_config 恢复 diff --git a/server/application/admin/controller/Ajax.php b/server/application/admin/controller/Ajax.php index 4fd33e1..de48fa8 100755 --- a/server/application/admin/controller/Ajax.php +++ b/server/application/admin/controller/Ajax.php @@ -40,12 +40,10 @@ class Ajax extends Backend { $this->request->get(['callback' => 'define']); $header = ['Content-Type' => 'application/javascript']; - if (!config('app_debug')) { - $offset = 30 * 60 * 60 * 24; // 缓存一个月 - $header['Cache-Control'] = 'public'; - $header['Pragma'] = 'cache'; - $header['Expires'] = gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; - } + // 语言包随后台文案调整实时生效,禁用长缓存避免浏览器继续使用旧翻译 + $header['Cache-Control'] = 'no-cache, no-store, must-revalidate'; + $header['Pragma'] = 'no-cache'; + $header['Expires'] = '0'; $controllername = $this->request->get('controllername'); $lang = $this->request->get('lang'); diff --git a/server/application/extra/site.php b/server/application/extra/site.php index 9f282bb..fbd2f32 100755 --- a/server/application/extra/site.php +++ b/server/application/extra/site.php @@ -1,10 +1,10 @@ '我的网站', + 'name' => '优匠优服', 'beian' => '', 'cdnurl' => '', - 'version' => '1.0.1', + 'version' => '1.0.2', 'timezone' => 'Asia/Shanghai', 'forbiddenip' => '', 'languages' => [ @@ -13,22 +13,22 @@ return [ ], 'fixedpage' => 'dashboard', 'categorytype' => [ - 'default' => 'Default', - 'page' => 'Page', - 'article' => 'Article', - 'test' => 'Test', + 'default' => '默认', + 'page' => '单页', + 'article' => '文章', + 'test' => '测试', ], 'configgroup' => [ - 'basic' => 'Basic', - 'email' => 'Email', - 'dictionary' => 'Dictionary', - 'user' => 'User', - 'example' => 'Example', + 'basic' => '基础配置', + 'email' => '邮箱配置', + 'dictionary' => '字典配置', + 'user' => '会员配置', + 'example' => '示例', ], 'attachmentcategory' => [ - 'category1' => 'Category1', - 'category2' => 'Category2', - 'custom' => 'Custom', + 'category1' => '分类1', + 'category2' => '分类2', + 'custom' => '自定义', ], 'mail_type' => '1', 'mail_smtp_host' => 'smtp.qq.com',