scorpio 2 rokov pred
rodič
commit
c7dd13697d
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      src/layout/top.vue

+ 4 - 1
src/layout/top.vue

@@ -170,7 +170,10 @@ export default {
   },
   methods: {
     initWebSocket() {
-      const wsuri = config.wss + this.user.info.userId
+      const wsuri =
+        location.host.indexOf('dev') > -1
+          ? 'ws://dev.wutongshucloud.com/ws/websocket/'
+          : config.wss + this.user.info.userId
       this.websock = new WebSocket(wsuri)
       this.websock.onmessage = this.websocketonmessage
       // 连接建立时触发