* [apiv2] Fix getFormData

This commit is contained in:
朱金勇
2025-10-22 09:46:00 +08:00
committed by Gitfox
parent 837eb24de2
commit 709539017d
+6 -3
View File
@@ -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;