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 = [