Browse Source

限制接口请求只允许post

master
wanghongjun 2 years ago
parent
commit
488a2306db
  1. 5
      application/api/controller/YingShiDevice.php

5
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();

Loading…
Cancel
Save