This commit is contained in:
2021-03-05 19:02:18 +08:00
parent 0ba5bc7410
commit 3ba2d4650b
+1 -2
View File
@@ -367,7 +367,7 @@ class Router extends HttpService implements RouterInterface
return null; return null;
} }
if (empty($explode)) { if (empty($explode)) {
return $parent; return $parent->findNode('/');
} }
while ($value = array_shift($explode)) { while ($value = array_shift($explode)) {
$node = $parent->findNode($value); $node = $parent->findNode($value);
@@ -481,7 +481,6 @@ class Router extends HttpService implements RouterInterface
public function dispatch(): mixed public function dispatch(): mixed
{ {
if (!($node = $this->find_path(\request()))) { if (!($node = $this->find_path(\request()))) {
var_dump(\request(), $node);
return send(self::NOT_FOUND); return send(self::NOT_FOUND);
} }
send($response = $node->dispatch(), 200); send($response = $node->dispatch(), 200);