diff --git a/pages/control/index.vue b/pages/control/index.vue index 45f59de..6968497 100644 --- a/pages/control/index.vue +++ b/pages/control/index.vue @@ -477,7 +477,7 @@ export default { this.value=1; } this.reset(); - this.disconnectMqtt(); + // this.disconnectMqtt(); }, reset() { @@ -581,7 +581,7 @@ export default { this.client.on('connect', () => { this.connected = true - this.client.subscribe(this.mqttConfig.subscribeTopic, { qos: 0 }) + this.client.subscribe('dtu/+/up', { qos: 0 }) this.addMessage('已连接到MQTT服务器') }) @@ -633,7 +633,7 @@ export default { }, ackMessage(topic, payload) { - console.info("处理回执消息") + // console.info("消息解析:"+topic,payload) // 1. 先判断是否是目标订阅主题(如dtu/xxx/up) @@ -650,6 +650,7 @@ export default { // console.info("回执消息:"+msgData) // 3. 区分“回执”和“其他内容” if (msgData.prop && "suc" in msgData) { + console.info("处理回执消息") // 👉 这是“指令回执” this.handleCommandAck(msgData,this.deviceType); }