zhuguifei
2025-09-02 9cc59c17892a7e69de54e06b5931e78c9b05551c
mqtt/MqttView.vue
@@ -15,6 +15,12 @@
      },
      destroyed() {
         console.error("MQTT组件销毁")
         this.$mqttTool.end().then(res => {
            console.error(res)
         })
      },
      methods: {
         initMqtt() {
            uni.getSystemInfo({
@@ -82,7 +88,8 @@
            
            //订阅干燥设备连接断开状态更新-租户内所有设备
            this.$mqttTool.subscribe({
               topic: this.$constant.SERVICE_BROADCAST_TENANT_UPDATE_EQU_STATU.replace('%s', this.tenantId),
               topic: this.$constant.SERVICE_BROADCAST_TENANT_UPDATE_EQU_STATU.replace('%s', this
                  .tenantId),
               qos: 0
            }).then(res => {
               console.error(res)
@@ -136,7 +143,7 @@
            })
            client.on('message', function(topic, message, buffer) {
               uni.$emit(that.$constant.MQTT_TOPIC_MESSAGE, message);
               console.error("收到message(总):"+topic)
               //console.error("收到message(总):"+topic)
            })