From 88727a0f30c6d42d59f3aa2c25d83b43a26b4ad1 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 28 Oct 2023 18:08:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=B3=BB=E7=BB=9F=E5=85=AC?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/NoteIndex.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/api/controller/NoteIndex.php b/app/api/controller/NoteIndex.php index 7f9a76b..9336510 100644 --- a/app/api/controller/NoteIndex.php +++ b/app/api/controller/NoteIndex.php @@ -51,6 +51,9 @@ class NoteIndex extends ApiController $this->checkAuth(); $id = empty(get_params('id')) ? 0 : get_params('id'); $note = Db::name('Note')->where(['id' => $id])->find(); + if (empty($note)) { + $this->apiError('公告不存在'); + } $note['cate_title'] = Db::name('NoteCate')->where(['id' => $note['cate_id']])->value('title'); $this->apiSuccess('获取成功', $note); }