fix(admin): 完善演示环境配置写入保护

同步系统设置、存储设置和调试模式的演示环境写入限制,保留正常读取及现有管理员权限校验。
This commit is contained in:
Anyon 2026-09-07 17:13:16 +08:00
parent 9d064cc01f
commit 121e56252e
2 changed files with 9 additions and 0 deletions

View File

@ -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');

View File

@ -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');