From e3b9b6f81b92971cc06ab328b922d3b8e835bb6d Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 3 Aug 2021 02:35:54 +0800 Subject: [PATCH] modify --- HttpServer/Route/Node.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index c93cddba..c81092f8 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -128,15 +128,6 @@ class Node extends HttpService $this->callback = $manager->callerMiddlewares( $this->handler[0], $this->handler[1], $this->aopHandler($this->getAop()) ); - - if ($this->path == '/user/attributes'){ - [$controller, $action] = $this->handler; - - $aspect = Snowflake::getDi()->getMethodAttribute($controller::class, $action); - - var_dump($aspect); - } - } return $this; } @@ -189,9 +180,22 @@ class Node extends HttpService if (empty($aspect)) { return null; } + +// if ($this->path == '/user/attributes'){ +// [$controller, $action] = $this->handler; +// +// $aspect = Snowflake::getDi()->getMethodAttribute($controller::class, $action); +// +// var_dump($aspect); +// } + foreach ($aspect as $value) { + $implements = class_implements($value); - if (isset($implements[IAspect::class])) { + if ($this->path == '/user/attributes') { + var_dump($aspect); + } + if (isset($implements[IAspect::class])) { return $value; } }