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