From 121e56252e8a5fa202d2d54127468a08107fcd97 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 7 Sep 2026 17:13:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E5=AE=8C=E5=96=84=E6=BC=94?= =?UTF-8?q?=E7=A4=BA=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE=E5=86=99=E5=85=A5?= =?UTF-8?q?=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 同步系统设置、存储设置和调试模式的演示环境写入限制,保留正常读取及现有管理员权限校验。 --- app/admin/controller/Config.php | 6 ++++++ app/admin/controller/api/System.php | 3 +++ 2 files changed, 9 insertions(+) diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 191606456..c7b100203 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -90,6 +90,9 @@ class Config extends Controller $this->themes = static::themes; $this->fetch(); } else { + if (RuntimeService::check('demo')) { + $this->error('演示环境禁止修改系统配置!'); + } $post = $this->request->post(); // 修改网站后台入口路径 if (!empty($post['xpath'])) { @@ -127,6 +130,9 @@ class Config extends Controller */ public function storage() { + if (!$this->request->isGet() && RuntimeService::check('demo')) { + $this->error('演示环境禁止修改系统配置!'); + } $this->_applyFormToken(); if ($this->request->isGet()) { $this->type = input('type', 'local'); diff --git a/app/admin/controller/api/System.php b/app/admin/controller/api/System.php index 5e02b8faf..e58a9edd5 100644 --- a/app/admin/controller/api/System.php +++ b/app/admin/controller/api/System.php @@ -80,6 +80,9 @@ class System extends Controller */ public function debug() { + if (RuntimeService::check('demo')) { + $this->error('演示环境禁止修改系统配置!'); + } if (AdminService::isSuper()) { if (input('state')) { RuntimeService::set('product');