改进Request类的host方法 支持仅仅获取host而不包含端口号

This commit is contained in:
thinkphp
2018-04-27 17:13:25 +08:00
parent f4301c8667
commit 4c046575b6
3 changed files with 9 additions and 5 deletions

View File

@@ -239,7 +239,7 @@ class Url
$rootDomain = Config::get('url_domain_root');
if (true === $domain) {
// 自动判断域名
$domain = Config::get('app_host') ?: $request->host();
$domain = Config::get('app_host') ?: $request->host(true);
$domains = Route::rules('domain');
if ($domains) {