src/Leevel/Router/Url.php
protected function withDomain(string $url, string $domain): string
    {
        if (!$this->option['domain'] || !$domain) {
            return $url;
        }

        return ($this->isSecure() ? 'https://' : 'http://').
            ($domain && '*' !== $domain ? $domain.'.' : '').
            $this->option['domain'].$url;
    }
protected function withDomain(string $url, string $domain): string
    {
        if (!$this->option['domain'] || !$domain) {
            return $url;
        }

        return ($this->isSecure() ? 'https://' : 'http://').
            ($domain && '*' !== $domain ? $domain.'.' : '').
            $this->option['domain'].$url;
    }
返回完整 URL 地址

@param string $url
@param string $domain

@return string