* [apiv2] Check zen

This commit is contained in:
朱金勇
2025-12-17 22:21:34 +08:00
committed by Gitfox
parent e38a13bc1c
commit f1e3c4bf66
+9 -6
View File
@@ -481,7 +481,7 @@ class api extends router
$this->control->getFormData = true;
$zen = $this->control->moduleName . 'Zen';
$this->control->$zen->getFormData = true;
if(isset($this->control->$zen)) $this->control->$zen->getFormData = true;
$control = $this->control; // fetch method will change control.
$method = $this->control->methodName;
@@ -490,20 +490,23 @@ class api extends router
/* Clean the output in get method. */
ob_clean();
$this->control = $control;
$this->control->getFormData = false;
$this->control->$zen->getFormData = false;
$this->control->viewType = 'json';
$this->control = $control;
$_POST = $postData;
foreach($this->control->formData as $key => $value)
{
if(!isset($_POST[$key])) $_POST[$key] = $value;
}
foreach($this->control->$zen->formData as $key => $value)
if(isset($this->control->$zen))
{
if(!isset($_POST[$key])) $_POST[$key] = $value;
$this->control->$zen->getFormData = false;
foreach($this->control->$zen->formData as $key => $value)
{
if(!isset($_POST[$key])) $_POST[$key] = $value;
}
}
}