소스 검색

no message

FengChaoYu 3 년 전
부모
커밋
15cd394af9
1개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 10 10
      src/layout/components/Navbar.vue

+ 10 - 10
src/layout/components/Navbar.vue

@@ -380,16 +380,16 @@ export default {
     // }
     initWebSocket: function () {
       // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
-      var userId = this.$store.getters.userid;
-
-      var url = process.env.VUE_APP_BASE_API.replace("https://","wss://").replace("http://","ws://").replace("api","supply")+"websocket/"+userId;
-      console.debug(userId, url);
-      let token = getToken()
-      this.websock = new WebSocket(url, [token]);
-      this.websock.onopen = this.websocketOnopen;
-      this.websock.onerror = this.websocketOnerror;
-      this.websock.onmessage = this.websocketOnmessage;
-      this.websock.onclose = this.websocketOnclose;
+      // var userId = this.$store.getters.userid;
+      //
+      // var url = process.env.VUE_APP_BASE_API.replace("https://","wss://").replace("http://","ws://").replace("api","supply")+"websocket/"+userId;
+      // console.debug(userId, url);
+      // let token = getToken()
+      // this.websock = new WebSocket(url, [token]);
+      // this.websock.onopen = this.websocketOnopen;
+      // this.websock.onerror = this.websocketOnerror;
+      // this.websock.onmessage = this.websocketOnmessage;
+      // this.websock.onclose = this.websocketOnclose;
     },
     websocketOnopen: function () {
       console.debug("WebSocket连接成功");