From 8a27933d444f03dca4727c553c0ffac0e6f23fff Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Tue, 17 Mar 2020 14:36:38 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Image.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/api/controller/Image.php b/application/api/controller/Image.php index c1898f6f..012a9812 100644 --- a/application/api/controller/Image.php +++ b/application/api/controller/Image.php @@ -26,8 +26,10 @@ class Image extends Base public function find() { - $id = $this->request->request('id'); - $image = $this->model->where(['id' => $id])->find(); + $id = $this->request->post('id'); + if (!$image = $this->model->where('id', $id)->find()) { + $this->response('未找到该图片数据', [], 500); + } $this->response('success', $this->parseData($image)); }