see999 před 4 roky
rodič
revize
3aba79bd36
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      src/views/layout/components/Navbar.vue

+ 7 - 1
src/views/layout/components/Navbar.vue Zobrazit soubor

@@ -305,6 +305,12 @@ export default {
305 305
               this.showWsErr = true;
306 306
               this.wsErrMsg = "网络已断开,请检查网络后重新打开页面";
307 307
               console.log('navigator',navigator)
308
+              let http = 'wss://socket.sgjyun.com?token=' 
309
+              // let http = 'ws://socket.szjkhd.com?token=' //测试
310
+              let token = localStorage.getItem("token")
311
+              this.$store.state.user.websocket = new ReconnectingWebSocket(
312
+                http + token
313
+              );
308 314
             } else if (
309 315
               navigator.onLine == true &&
310 316
               this.websocket.readyState == 1
@@ -312,7 +318,7 @@ export default {
312 318
               this.showWsErr = false;
313 319
             }
314 320
             this.websocket.send("1");
315
-          }, 55000);
321
+          }, 30000);
316 322
         }
317 323
         
318 324
       }).catch(error => {