From 313111f809bcc9351d7342cc6aad5e6dc79f2cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Sun, 4 Jan 2026 13:20:54 +0800 Subject: [PATCH] * [apiv2] Fix checkObjectExists --- framework/api/router.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/api/router.class.php b/framework/api/router.class.php index 38d618b6bc..de960df521 100644 --- a/framework/api/router.class.php +++ b/framework/api/router.class.php @@ -516,11 +516,15 @@ class api extends router if($this->apiVersion == 'v2') { $this->setParams(); + if(in_array($this->action, array('post', 'put', 'delete'))) { - $this->checkObjectExists(); $this->setFormData(); } + else + { + $this->checkObjectExists(); + } return parent::loadModule(); } @@ -584,6 +588,8 @@ class api extends router if(isset($this->params[$key])) $this->params[$key] = $value; } + $this->checkObjectExists(); + /* 其他方法不需要从GET页面获取post data。Other request directly. */ if(!in_array($this->methodName, ['create', 'edit'])) return;