wangming 2 місяців тому
батько
коміт
a007e93643
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      src/components/component/alarModel.vue

+ 3 - 1
src/components/component/alarModel.vue

@@ -500,7 +500,9 @@ export default {
         },
     },
     beforeMount() {
-        this.connectMQTT();
+        if (uni.getStorageSync("userId")) {
+            this.connectMQTT();
+        }
     },
     onHide() {
         if (this.mqttClient) this.mqttClient.end(true);