From 8cc77d2852e2ccaa1bec169aaced4ab563345537 Mon Sep 17 00:00:00 2001 From: lld <15027638633@163.com> Date: Mon, 29 Dec 2025 01:06:00 +0800 Subject: [PATCH] =?UTF-8?q?mqtt=E5=B7=A5=E5=85=B7=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/demo/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pages/demo/index.vue b/pages/demo/index.vue index 416e6d4..ed2ecd4 100644 --- a/pages/demo/index.vue +++ b/pages/demo/index.vue @@ -238,10 +238,10 @@ export default { return { // MQTT配置 mqttConfig: { - broker: 'ws://1.94.254.176:9001/mqtt', // 公共测试服务器 + broker: '', // 公共测试服务器 clientId: 'uniapp_mqtt_' + Math.random().toString(16).substr(2, 8), - username: 'admin', - password: 'Admin#12345678', + username: '', + password: '', timeout: 30 }, // 连接状态 @@ -349,7 +349,8 @@ export default { password: this.mqttConfig.password, connectTimeout: (this.mqttConfig.timeout || 30) * 1000, keepalive: 60, - clean: true + clean: true, + reconnectPeriod: 0 } // 创建客户端并连接