From 21c1aaa42c4120204cef5b6e3f64a0a1d19fd3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 16 Dec 2020 15:42:27 +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 | 1 + HttpServer/Route/Router.php | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 3145afcb..92191709 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -438,6 +438,7 @@ class Node extends Application if (empty($this->callback)) { return JSON::to(404, $node->_error ?? 'Page not found.'); } + var_dump($this->callback); $requestParams = func_get_args(); if (func_num_args() > 0) { return call_user_func($this->callback, ...$requestParams); diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index 36615ba3..b7667000 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -481,13 +481,12 @@ class Router extends Application implements RouterInterface return send(self::NOT_FOUND, 404); } send($node->dispatch(), 200); -// if ($node->hasAfter()) { -// $node->afterDispatch(\request()); -// } + if ($node->hasAfter()) { + $node->afterDispatch(\request()); + } } catch (ExitException $exception) { send($exception->getMessage(), $exception->getCode()); } catch (\Throwable $exception) { - var_dump($exception->getMessage()); send($this->exception($exception), 200); } }