src/Leevel/Router/RouterProvider.php
protected function setMiddleware(): void
    {
        if (null !== $this->middlewareGroups) {
            $this->container['router']->setMiddlewareGroups($this->middlewareGroups);
        }

        if (null !== $this->middlewareAlias) {
            $this->container['router']->setMiddlewareAlias($this->middlewareAlias);
        }
    }
protected function setMiddleware(): void
    {
        if (null !== $this->middlewareGroups) {
            $this->container['router']->setMiddlewareGroups($this->middlewareGroups);
        }

        if (null !== $this->middlewareAlias) {
            $this->container['router']->setMiddlewareAlias($this->middlewareAlias);
        }
    }
设置中间件.