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