From c537a0a53a178f8ee30b435e81ff529375a9430e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 5 Mar 2021 17:37:12 +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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 551f64cb..a47cd58f 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -321,9 +321,6 @@ class Node extends HttpService if (empty($annotation)) { return $node; } - if (str_contains($node->path, 'switch/map')) { - var_dump($className, $action, $annotation); - } foreach ($annotation as $name => $attribute) { if ($attribute instanceof \Annotation\Route\Interceptor) { $node->addInterceptor($attribute->interceptor); @@ -338,6 +335,9 @@ class Node extends HttpService $node->addLimits($attribute->limits); } } + if (!empty($node->handler)) { + $node->callback = Reduce::reduce($node->createDispatch(), $node->annotation($node)); + } return $node; } @@ -512,9 +512,6 @@ class Node extends HttpService if (is_string($closure)) { $closure = [Snowflake::createObject($closure), 'onHandler']; } - if (str_contains($this->path, 'switch/map')) { - var_dump($closure, $this->middleware); - } if (in_array($closure, $this->middleware)) { continue; }