From f36ceb77defa2a71fd9818c91b6ea8e587f7d6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Feb 2021 14:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Route/Node.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index a04f409a..85518949 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -450,8 +450,11 @@ class Node extends HttpService */ public function dispatch(): mixed { - if (empty($this->callback) && $this->restructure()) { - return Json::to(404, $node->_error ?? 'Page not found.'); + if (empty($this->callback)) { + $this->restructure(); + if (empty($this->callback)) { + return Json::to(404, $node->_error ?? 'Page not found.'); + } } $requestParams = func_get_args();