From 79dc8a05eeaf56785fa8707f81550153d273ecc2 Mon Sep 17 00:00:00 2001 From: augushong Date: Tue, 23 Mar 2021 20:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B1=E6=95=88=E9=93=BE=E6=8E=A5=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Post.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/index/controller/Post.php b/app/index/controller/Post.php index aeca4b0..34b302a 100644 --- a/app/index/controller/Post.php +++ b/app/index/controller/Post.php @@ -58,6 +58,10 @@ class Post extends Common } ])->where('uid', $uid)->find(); + if (empty($model_post)) { + return $this->error('链接已失效', '/'); + } + $model_post->hits = $model_post->hits + 1; $model_post->save();