From 709539017d6261b749401b3d2735fdce41a40ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Wed, 22 Oct 2025 09:46:00 +0800 Subject: [PATCH] * [apiv2] Fix getFormData --- framework/api/router.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/framework/api/router.class.php b/framework/api/router.class.php index cf42506efe..5e7af07db2 100644 --- a/framework/api/router.class.php +++ b/framework/api/router.class.php @@ -454,11 +454,15 @@ class api extends router $this->control->viewType = 'html'; $this->control->getFormData = true; + $zen = $this->control->moduleName . 'Zen'; + $this->control->$zen->getFormData = true; + $method = $this->control->methodName; call_user_func_array(array($this->control, $method), $_GET); - $this->control->getFormData = false; - $this->control->viewType = 'json'; + $this->control->getFormData = false; + $this->control->$zen->getFormData = false; + $this->control->viewType = 'json'; $_POST = $postData; foreach($this->control->formData as $key => $value) @@ -466,7 +470,6 @@ class api extends router if(!isset($_POST[$key])) $_POST[$key] = $value; } - $zen = $this->control->moduleName . 'Zen'; foreach($this->control->$zen->formData as $key => $value) { if(!isset($_POST[$key])) $_POST[$key] = $value;