From ec3671b0577f85610bdbea77cd88ea7704b7d4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 5 Mar 2021 18:42:14 +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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index fd110854..5a4bd10d 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -75,6 +75,8 @@ class Node extends HttpService $controller = implode('\\', $this->namespace) . '\\' . $controller; } $this->handler = $this->getReflect($controller, $action); + + $this->callback = Reduce::reduce($this->createDispatch(), $this->annotation()); } else if ($handler != null && !is_callable($handler, true)) { $this->_error = 'Controller is con\'t exec.'; } else if ($handler instanceof Closure) { @@ -278,7 +280,7 @@ class Node extends HttpService throw new Exception('method ' . $action . ' not exists at ' . $controller . '.'); } - $this->annotationInject($reflect->getName(), $action); + $this->annotationInject(get_class($controller), $action); return [$reflect->newInstance(), $action]; } catch (Throwable $exception) {