src/Leevel/Router/Match/Match.php
protected function matcheBasePaths(string $pathInfo): array
    {
        $middlewares = [];

        foreach ($this->router->getBasePaths() as $item => $option) {
            if ('*' === $item) {
                if (isset($option['middlewares'])) {
                    $middlewares = $option['middlewares'];
                }
            } elseif (preg_match($item, $pathInfo, $matches)) {
                if (isset($option['middlewares'])) {
                    $middlewares = $this->mergeMiddlewares($middlewares, $option['middlewares']);
                }

                break;
            }
        }

        return $middlewares;
    }
protected function matcheBasePaths(string $pathInfo): array
    {
        $middlewares = [];

        foreach ($this->router->getBasePaths() as $item => $option) {
            if ('*' === $item) {
                if (isset($option['middlewares'])) {
                    $middlewares = $option['middlewares'];
                }
            } elseif (preg_match($item, $pathInfo, $matches)) {
                if (isset($option['middlewares'])) {
                    $middlewares = $this->mergeMiddlewares($middlewares, $option['middlewares']);
                }

                break;
            }
        }

        return $middlewares;
    }
匹配基础路径.

@param string $pathInfo

@return array