Forráskód Böngészése

提交mqtt连接提示

wangming07 4 hete
szülő
commit
f06df2fd81
1 módosított fájl, 7 hozzáadás és 8 törlés
  1. 7 8
      src/utils/globalMqtt.js

+ 7 - 8
src/utils/globalMqtt.js

@@ -45,11 +45,13 @@ class MqttService {
 
     // 连接 DATA
     connectData(userId) {
+
         uni.showToast({
-            title: "mqtt连接中...",
-            icon: "none",
-            duration: 1500,
+            title: "正在连接平台中...",
+            icon: "loading",
+            duration: 2000, //持续的时间
         });
+
         if (this.dataConnected && this.dataClient) {
             uni.hideToast()
             console.log("DATA MQTT 已连接,复用现有实例");
@@ -125,7 +127,7 @@ class MqttService {
             client.on('error', (err) => {
                 uni.showModal({
                     title: '提示',
-                    content: 'mqtt连接失败,请重新登录',
+                    content: '连接平台失败,请重新登录',
                     showCancel: false,
                     success: (res) => {
                         if (res.confirm) {
@@ -135,10 +137,7 @@ class MqttService {
                             })
                         }
                         if (res.cancel) {
-                            uni.clearStorageSync();
-                            uni.reLaunch({
-                                url: "/pagesA/loginNew/loginNew"
-                            })
+
                         }
                     }
                 })