From 018e4ae40bfb6fb3d5169bbc0570c2d2fd2c7c5a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 1 Dec 2023 16:58:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/IndexController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index 459c3c7..625b98c 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -19,6 +19,9 @@ class IndexController extends BaseController{ public function mqtt(){ $parmas=$this->request->post(); + if(!$parmas|| !isset($parmas['username']) || $parmas['username']==''){ + return json(['msg'=>'参数错误']); + } $data=[ 'username'=>$parmas['username'], 'topic'=>$parmas['topic'],