From bc828f73e012cd89201f4d0aa2539cd46c4176c5 Mon Sep 17 00:00:00 2001 From: augushong Date: Sat, 12 Feb 2022 19:50:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=AE=BF=E9=97=AE=E9=93=BE?= =?UTF-8?q?=E6=8E=A5;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/model/Post.php | 4 ++-- public/index.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/model/Post.php b/app/model/Post.php index 1f0b8cd..5fedc6c 100644 --- a/app/model/Post.php +++ b/app/model/Post.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace app\model; use think\facade\Cache; +use think\facade\Request; use think\Model; use think\model\concern\SoftDelete; use think\Paginator; @@ -155,9 +156,8 @@ class Post extends Model public function getReadUrlAttr() { - $url_info = parse_url((string)url('index/Index/index')->domain('www')); - return $url_info['scheme'] . '://' . $url_info['host'] . '/index/a' . $this->getData('uid') . '.html'; + return Request::domain() . '/index/a' . $this->getData('uid') . '.html'; } public function getShareTextAttr() diff --git a/public/index.php b/public/index.php index e3c0fe9..a83f70c 100644 --- a/public/index.php +++ b/public/index.php @@ -20,5 +20,4 @@ $http = (new App())->http; $response = $http->run(); $response->send(); - $http->end($response);