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 } // 创建客户端并连接