From 488a2306dbf17bec47efda3a5f9bb91c56d7432e Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Mon, 4 Dec 2023 15:41:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E6=8E=A5=E5=8F=A3=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=8F=AA=E5=85=81=E8=AE=B8post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/YingShiDevice.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/api/controller/YingShiDevice.php b/application/api/controller/YingShiDevice.php index aa4c68b..6b050f8 100644 --- a/application/api/controller/YingShiDevice.php +++ b/application/api/controller/YingShiDevice.php @@ -3,6 +3,7 @@ namespace app\api\controller; use app\common\YingShiSdk\YingShiSdk; +use think\Request; class YingShiDevice extends Base { @@ -10,6 +11,8 @@ class YingShiDevice extends Base public function deviceStatus() { try { + $request = Request::instance(); + if (!$request->isPost()) throw new \Exception("请求失败,仅允许POST请求方式"); $curlData = YingShiSdk::DeviceStatus(); @@ -24,6 +27,8 @@ class YingShiDevice extends Base public function deviceInfo() { try { + $request = Request::instance(); + if (!$request->isPost()) throw new \Exception("请求失败,仅允许POST请求方式"); $curlData = YingShiSdk::DeviceInfo();