From fece59aa148407a7dfd2fbfa1274d39d10347ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 27 Sep 2021 16:22:07 +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 --- http-handler/Handler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/http-handler/Handler.php b/http-handler/Handler.php index eaebf4c9..fdc6f67a 100644 --- a/http-handler/Handler.php +++ b/http-handler/Handler.php @@ -47,6 +47,8 @@ class Handler $this->_middlewares = MiddlewareManager::get($this->callback); $aspect = NoteManager::getSpecify_annotation(Aspect::class, $this->callback[0], $this->callback[1]); + + $this->callback[0] = Kiri::getDi()->get($this->callback[0]); if (!is_null($aspect)) { $this->recover($aspect); } @@ -69,9 +71,8 @@ class Handler $this->params = []; $this->callback = static function () use ($aspect, $callback, $params) { $aspect->before(); - $result = $aspect->invoke([$callback, $callback[1]], $params); + $result = $aspect->invoke($callback, $params); $aspect->after($result); - return $result; }; }