彭宇 2 anni fa
parent
commit
f1e5466f53
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      src/views/forest.vue

+ 2 - 1
src/views/forest.vue

@@ -710,6 +710,7 @@ export default {
   /** ----------------------------------weosocket开始------------------------------------- */
   destroyed() { //离开页面关闭Socket连接
     if (this.websock) {
+      clearInterval(this.setIntervalWesocketPush)
       this.websock.close()
       this.websock = null
     }
@@ -718,7 +719,7 @@ export default {
   methods: {
     /** ----------------------------------weosocket开始------------------------------------- */
     initWebSocket() { //初始化weosocket
-      const wsuri = 'ws://192.168.1.103:10012/websocket/forest-' + Cookies.get('username')
+      const wsuri = 'wss://www.hmzzxc.com:10012/websocket/forest-' + Cookies.get('username')
       this.websock = new WebSocket(wsuri)
       console.log('建立websocket连接')
       this.websock.onopen = this.websocketonopen