This commit is contained in:
2021-02-25 14:42:26 +08:00
parent 8539971ca0
commit 9b1c28e735
6 changed files with 23 additions and 54 deletions
+6 -7
View File
@@ -472,14 +472,13 @@ class Router extends HttpService implements RouterInterface
public function dispatch(): mixed
{
if (!($node = $this->find_path(\request()))) {
return send(self::NOT_FOUND, 404);
} else {
send($response = $node->dispatch(), 200);
if (!$node->hasAfter()) {
return null;
}
return $node->afterDispatch($response);
return send(self::NOT_FOUND);
}
send($response = $node->dispatch(), 200);
if (!$node->hasAfter()) {
return null;
}
return $node->afterDispatch($response);
}