From 6ea37e0f82d5bc24ea528f3090d32261d6ba8409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 20 Apr 2021 11:51:02 +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, 5 insertions(+), 4 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 80427454..d81d1c0b 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -17,9 +17,7 @@ use HttpServer\Controller; use HttpServer\Http\Request; use HttpServer\HttpFilter; use JetBrains\PhpStorm\Pure; -use ReflectionException; use Snowflake\Core\Json; -use Snowflake\Exception\NotFindClassException; use Snowflake\Snowflake; use Throwable; use validator\Validator; @@ -534,8 +532,11 @@ class Node extends HttpService if ($this->handler instanceof Closure) { return call_user_func($this->handler, func_get_args()); } - return $this->runWith($this->callback, func_get_args()); - + if (func_num_args() >= 1) { + return $this->runWith($this->callback, func_get_args()); + } else { + return $this->runWith($this->callback, \request()); + } return $this->runFilter(...func_get_args()); } catch (Throwable $throwable) { $this->addError($throwable, 'throwable');