This commit is contained in:
@@ -32,7 +32,17 @@ class ThemeController extends PluginAdminBaseController
|
|||||||
*/
|
*/
|
||||||
public function save(): Response
|
public function save(): Response
|
||||||
{
|
{
|
||||||
|
// 兼容 application/json 与表单提交两种方式获取参数
|
||||||
$param = $this->request->param();
|
$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 结构保持一致,只取需要的字段入库
|
||||||
$payload = [
|
$payload = [
|
||||||
|
|||||||
Reference in New Issue
Block a user