From 532a3cf0e8833954b4c6358c0a5e4c5cdef56740 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sun, 5 Sep 2021 04:03:07 +0800 Subject: [PATCH] 111 --- http-helper/Route/Router.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-helper/Route/Router.php b/http-helper/Route/Router.php index 4d365641..7f35c782 100644 --- a/http-helper/Route/Router.php +++ b/http-helper/Route/Router.php @@ -430,7 +430,7 @@ class Router extends HttpService implements RouterInterface $paths = []; foreach ($this->nodes as $_node) { /** @var Node[] $node */ - $paths[] = ['method' => $_node->method, 'path' => $_node->sourcePath]; + $paths[] = ['method' => $_node->method, 'path' => $_node->sourcePath, 'alias' => $_node->getAlias()]; $paths = $this->getChildes($_node, $paths); } return $paths; @@ -445,7 +445,7 @@ class Router extends HttpService implements RouterInterface private function getChildes(Node $node, array $path): array { foreach ($node->childes as $item) { - $path[] = ['method' => $item->method, 'path' => $item->sourcePath]; + $path[] = ['method' => $item->method, 'path' => $item->sourcePath, 'alias' => $item->getAlias()]; if (!empty($item->childes)) { $path = $this->getChildes($item, $path); }