From 5baff4bb855034d02286eef693d3283bd06a16f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Thu, 8 Jan 2026 11:05:52 +0800 Subject: [PATCH] * [apiv2] Fix delete method. --- framework/api/router.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/framework/api/router.class.php b/framework/api/router.class.php index 12eeda6543..f6dbf4464c 100644 --- a/framework/api/router.class.php +++ b/framework/api/router.class.php @@ -325,9 +325,6 @@ class api extends router else { $_GET[$moduleName.'ID'] = $pathItems[1]; - - /* Set default params and post data to delete.*/ - if($this->action == 'delete') $_GET['confirm'] = 'yes'; } } else @@ -342,6 +339,13 @@ class api extends router $this->setModuleName($moduleName); $this->setMethodName($methodName); $this->setControlFile(); + + /* Set default params and post data to delete.*/ + if($this->action == 'delete') + { + $defaultParams = $this->getDefaultParams(); + if(isset($defaultParams['confirm'])) $_GET['confirm'] = 'yes'; + } } /**