From 55d4de847fe1c74c8c3d36f17df2e94a81ac170d Mon Sep 17 00:00:00 2001 From: yiqiu Date: Fri, 21 Nov 2025 13:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme_configurator/controller/ThemeController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/addon/theme_configurator/controller/ThemeController.php b/plugins/addon/theme_configurator/controller/ThemeController.php index b61307d..e97976a 100644 --- a/plugins/addon/theme_configurator/controller/ThemeController.php +++ b/plugins/addon/theme_configurator/controller/ThemeController.php @@ -32,7 +32,17 @@ class ThemeController extends PluginAdminBaseController */ public function save(): Response { + // 兼容 application/json 与表单提交两种方式获取参数 $param = $this->request->param(); + if (empty($param)) { + $raw = $this->request->getContent(); + if ($raw) { + $json = json_decode($raw, true); + if (is_array($json)) { + $param = $json; + } + } + } // 与前端 payload 结构保持一致,只取需要的字段入库 $payload = [