From 9f475b8b70c6ebb5881c42a120a057524db9c1e2 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sun, 21 Jan 2024 12:00:11 +0800 Subject: [PATCH] add mqtt --- app/api/controller/MqttController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/api/controller/MqttController.php b/app/api/controller/MqttController.php index 5d7526f..63ab1b7 100644 --- a/app/api/controller/MqttController.php +++ b/app/api/controller/MqttController.php @@ -14,13 +14,14 @@ class MqttController extends BaseApiController private string $username = "root"; private string $password = "root"; private ?ConnectionSettings $settings; + public array $notNeedLogin = ['upload']; /** * @throws ProtocolNotSupportedException */ - public function __construct(App $app) + public function initialize() { - parent::__construct($app); + parent::initialize(); # mqtt配置 $this->mqtt_client = new MqttClient($this->host, $this->port); $this->settings = new ConnectionSettings();