改进Request的baseUrl方法

This commit is contained in:
thinkphp
2016-05-19 16:57:05 +08:00
parent c006e281cb
commit 9a8b8d8a8d

View File

@@ -216,10 +216,8 @@ class Request
} elseif ($this->baseUrl) { } elseif ($this->baseUrl) {
return $this->baseUrl; return $this->baseUrl;
} else { } else {
$url = $this->scheme() . '://' . $this->host(); $this->baseUrl = rtrim($this->url(), '?' . $this->query());
$url .= $_SERVER['PHP_SELF']; return $this->baseUrl;
$this->baseUrl = $url;
return $url;
} }
} }