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; }