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);