Jelajahi Sumber

修改socket 监控中心

JX.LI 2 tahun lalu
induk
melakukan
517178e3b7
1 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 7 0
      src/components/vBottomMenu.vue

+ 7 - 0
src/components/vBottomMenu.vue

@@ -513,6 +513,13 @@
 				this.deptOptionsLiandong = response.data
 				this.deptOptionsLiandong = response.data
 			})
 			})
 		},
 		},
+    destroyed() { //离开页面关闭Socket连接
+      if (this.websock) {
+        clearInterval(this.setIntervalWesocketPush)
+        this.websock.close()
+        this.websock = null
+      }
+    },
     mounted() {
     mounted() {
       this.websockSid.userId=Cookies.get("userId")
       this.websockSid.userId=Cookies.get("userId")
     },
     },