From 9a8b8d8a8d044cbead8e4e5dfc9a5f575a823701 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 19 May 2016 16:57:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=9A=84baseUrl?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index f7aff0db..50c8707d 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -216,10 +216,8 @@ class Request } elseif ($this->baseUrl) { return $this->baseUrl; } else { - $url = $this->scheme() . '://' . $this->host(); - $url .= $_SERVER['PHP_SELF']; - $this->baseUrl = $url; - return $url; + $this->baseUrl = rtrim($this->url(), '?' . $this->query()); + return $this->baseUrl; } }