改名
This commit is contained in:
@@ -390,7 +390,6 @@ class Router extends HttpService implements RouterInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array|null $explode
|
* @param array|null $explode
|
||||||
* @param $method
|
|
||||||
* @return Node|null
|
* @return Node|null
|
||||||
* 查找指定路由
|
* 查找指定路由
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
@@ -537,18 +536,19 @@ class Router extends HttpService implements RouterInterface
|
|||||||
* @param RequestInterface $request
|
* @param RequestInterface $request
|
||||||
* @return Node|null
|
* @return Node|null
|
||||||
* 树杈搜索
|
* 树杈搜索
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function Branch_search(RequestInterface $request): ?Node
|
public function Branch_search(RequestInterface $request): ?Node
|
||||||
{
|
{
|
||||||
$uri = $request->getUri();
|
$uri = $request->getUri();
|
||||||
$node = $this->tree_search($uri->getExplode(), $request->getMethod());
|
$node = $this->tree_search($uri->getExplode());
|
||||||
if ($node instanceof Node) {
|
if ($node instanceof Node) {
|
||||||
return $node;
|
return $node;
|
||||||
}
|
}
|
||||||
if (!$request->isMethod('OPTIONS')) {
|
if (!$request->isMethod('OPTIONS')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$node = $this->tree_search(['*'], $request->getMethod());
|
$node = $this->tree_search(['*']);
|
||||||
if (!($node instanceof Node)) {
|
if (!($node instanceof Node)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user