From 8f2ed014ccb7417f548afe7e80b781518f694ef4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 21 Dec 2016 11:22:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB=E7=9A=84doma?= =?UTF-8?q?in=E6=96=B9=E6=B3=95=20=E5=8C=85=E5=90=AB=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/Request.php b/library/think/Request.php index 086e366e..2b0fda30 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -25,7 +25,7 @@ class Request protected $method; /** - * @var string 域名 + * @var string 域名(含协议和端口) */ protected $domain; @@ -270,6 +270,9 @@ class Request } elseif (!$this->domain) { $this->domain = $this->scheme() . '://' . $this->host(); } + if (80 != $this->port()) { + $this->domain .= ':' . $this->port(); + } return $this->domain; }