src/Leevel/Router/Match/Annotation.php
protected function matcheDomain(array $routers)
    {
        $domainVars = [];

        if (!empty($routers['domain'])) {
            // ignore the port
            $host = $this->request->getHost();

            if (!empty($routers['domain_regex'])) {
                if (!preg_match($routers['domain_regex'], $host, $matches)) {
                    return false;
                }

                array_shift($matches);

                foreach ($routers['domain_var'] as $var) {
                    $value = array_shift($matches);

                    $domainVars[$var] = $value;
                    $this->addVariable($var, $value);
                }
            } elseif ($host !== $routers['domain']) {
                return false;
            }
        }

        return $domainVars;
    }
protected function matcheDomain(array $routers)
    {
        $domainVars = [];

        if (!empty($routers['domain'])) {
            // ignore the port
            $host = $this->request->getHost();

            if (!empty($routers['domain_regex'])) {
                if (!preg_match($routers['domain_regex'], $host, $matches)) {
                    return false;
                }

                array_shift($matches);

                foreach ($routers['domain_var'] as $var) {
                    $value = array_shift($matches);

                    $domainVars[$var] = $value;
                    $this->addVariable($var, $value);
                }
            } elseif ($host !== $routers['domain']) {
                return false;
            }
        }

        return $domainVars;
    }
域名匹配.

@param array $routers

@return array|bool