This commit is contained in:
chenbo 2024-01-21 12:00:11 +08:00
parent e3d7c46ce1
commit 9f475b8b70
1 changed files with 3 additions and 2 deletions

View File

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