This commit is contained in:
2021-09-06 18:54:14 +08:00
parent 74222ea346
commit 3e6d11f76f
2 changed files with 17 additions and 18 deletions
+2 -1
View File
@@ -418,6 +418,7 @@ class Router extends HttpService implements RouterInterface
public function split($path): ?array
{
$path = $this->addPrefix() . '/' . ltrim($path, '/');
return [$path];
if ($path === '/') {
return ['/'];
}
@@ -505,7 +506,7 @@ class Router extends HttpService implements RouterInterface
// }
// } else {
// }
$node = $this->tree_search($uri->getExplode());
$node = $this->tree_search([$uri->getPath()]);
if (!($node instanceof Node)) {
return null;
}