wangzhe 2 tahun lalu
induk
melakukan
03fc0c5e3d
2 mengubah file dengan 9 tambahan dan 5 penghapusan
  1. 1 1
      src/dahua/TVWalllib/main.ts
  2. 8 4
      src/views/forest.vue

+ 1 - 1
src/dahua/TVWalllib/main.ts

@@ -530,4 +530,4 @@ function getScrollbarWidth() {
 	document.body.removeChild(scrollDiv);
 
 	return scrollbarWidth;
-}
+}

+ 8 - 4
src/views/forest.vue

@@ -502,7 +502,7 @@
       this.getExposureStage(this.getCurrentDataStr())
       this.getSupermap(this.getCurrentDataStr())
       /** ----------------------------------weosocket开始------------------------------------- */
-      // this.initWebSocket()
+      this.initWebSocket()
       /** ----------------------------------weosocket结束------------------------------------- */
       this.selectTaskList() //获取任务
       setInterval(() => {
@@ -1121,7 +1121,8 @@
       /** ----------------------------------weosocket开始------------------------------------- */
       initWebSocket() { //初始化weosocket
         // const wsuri = 'ws://127.0.0.1:10003/webSocket/' + Cookies.get('username')
-        const wsuri = 'ws://127.0.0.1:10003/webSocket/admin'
+        const wsuri = 'ws://121.36.228.66:10003/webSocket/admin'
+        // const wsuri = 'ws://121.36.228.66:100036/webSocket/admin'
         this.websock = new WebSocket(wsuri)
         console.log('建立websocket连接')
         this.websock.onopen = this.websocketonopen
@@ -1137,9 +1138,12 @@
         this.initWebSocket()
       },
       websocketonmessage(e) { //数据接收
-        console.log('接收数据', e.data)
+        console.log('你看e是啥', e)//{"fromId":"forest","fromUserId":"admin","toUserId":"admin"}
+        console.log('接收数据', e.data)//{"fromId":"forest","fromUserId":"admin","toUserId":"admin"}
+        console.log('接收数据强哥 哈哈哈', e.data)//{"fromId":"forest","fromUserId":"admin","toUserId":"admin"}
         // let data = "{\"fromId\":\"forest\",\"fromUserId\":\""+Cookies.get('username')+"\",\"toUserId\":\""+Cookies.get('username')+"\"}";
-        let data = "{\"fromId\":\"forest\",\"fromUserId\":\"admin\",\"toUserId\":\"admin\"}";
+        // let data = "{\"fromId\":\"forest\",\"fromUserId\":\"admin\",\"toUserId\":\"admin\"}";
+        let data = e.data;
         if (this.calendarDay == this.getCurrentDataStr() && data != e.data) {
           this.getWebSocketEvent(e.data);