diff --git a/library/think/Url.php b/library/think/Url.php index 51e2d89c..9f725e2c 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -272,7 +272,12 @@ class Url $domain .= '.' . $rootDomain; } } - return ($request->isSsl() || Config::get('is_https') ? 'https://' : 'http://') . $domain; + if (false !== strpos($domain, ':')) { + $scheme = ''; + } else { + $scheme = $request->isSsl() || Config::get('is_https') ? 'https://' : 'http://'; + } + return $scheme . $domain; } // 解析URL后缀