zhuliu 2 лет назад
Родитель
Сommit
63db7ec7c0

+ 2 - 2
RMS-FrontEnd/src/components/Layout/mixins/index.js

@@ -4,8 +4,8 @@ import Store from '@/store'
 export const webSocket = {
   methods: {
     connectWebSocket(userId) {
-      let webSocket = new WebSocket(`ws://139.224.24.90:8872/api/v2/ws/` + userId)
-      // let webSocket = new WebSocket(`ws://139.224.24.90:8885/api/v2/ws/` + userId)
+      // let webSocket = new WebSocket(`ws://139.224.24.90:8872/api/v2/ws/` + userId)
+      let webSocket = new WebSocket(`ws://${this.$c.hostname}:8877/api/v2/ws/`+userId)
       Store.commit('SET_WEB_SOCKET', webSocket)
       webSocket.onopen = () => {
         console.log('WebSocket连接成功')

+ 10 - 10
RMS-FrontEnd/src/views/components/task/components/realTime.vue

@@ -117,14 +117,14 @@ export default {
     };
   },
   watch: {
-    webSockets(val){
-      this.initTask2()
-    }
+    // webSockets(val){
+    //   this.initTask2()
+    // }
   },
   computed: {
-    webSocket1(){
-      return this.webSockets
-    }
+    // webSocket1(){
+    //   return this.webSockets
+    // }
   },
   created() {},
   mounted() {
@@ -136,10 +136,10 @@ export default {
       var webSocket = this.webSocket
       this.initTask(webSocket)
     },
-    initTask2(){
-      var webSocket = this.webSocket1
-      this.initTask(webSocket)
-    },
+    // initTask2(){
+    //   var webSocket = this.webSocket1
+    //   this.initTask(webSocket)
+    // },
     initTask(webSocket) {
       if(!webSocket){
         return false

+ 1 - 1
RMS-FrontEnd/src/views/components/task/components/todoList.vue

@@ -278,7 +278,7 @@ export default {
     },
     //更新日志
     updateLog(row){
-      var webSocket = this.webSockets || this.webSocket
+      var webSocket = this.webSocket
       this.$refs.updateLog.open(row,webSocket)
     },
     // 网站导入暂停,继续任务操作

+ 15 - 15
RMS-FrontEnd/src/views/components/task/index.vue

@@ -42,23 +42,23 @@ export default {
   created() {},
   mounted() {
     this.getHeight()
-    this.connectWebSocket()
+    // this.connectWebSocket()
   },
   methods: {
-    connectWebSocket() {
-      let webSocket = new WebSocket(`ws://${this.$c.hostname}:8877/api/v2/ws/`+this.userinfo.id)
-      // let webSocket = new WebSocket(`ws://192.168.1.24:8877/api/v2/ws/`+this.userinfo.id)
-      this.webSocket = webSocket
-      webSocket.onopen = () => {
-        console.log('WebSocket连接成功')
-      }
-      webSocket.onerror = () => {
-        console.log('WebSocket连接失败')
-      }
-      webSocket.onclose = () => {
-        console.log('WebSocket连接关闭')
-      }
-    },
+    // connectWebSocket() {
+    //   let webSocket = new WebSocket(`ws://${this.$c.hostname}:8877/api/v2/ws/`+this.userinfo.id)
+    //   // let webSocket = new WebSocket(`ws://192.168.1.24:8877/api/v2/ws/`+this.userinfo.id)
+    //   this.webSocket = webSocket
+    //   webSocket.onopen = () => {
+    //     console.log('WebSocket连接成功')
+    //   }
+    //   webSocket.onerror = () => {
+    //     console.log('WebSocket连接失败')
+    //   }
+    //   webSocket.onclose = () => {
+    //     console.log('WebSocket连接关闭')
+    //   }
+    // },
     getQueueList(){
       this.review = true
       this.$nextTick(()=>{

+ 2 - 2
RMS-FrontEnd/src/views/layout/mixins/index.js

@@ -4,8 +4,8 @@ import Store from '@/store'
 export const webSocket = {
   methods: {
     connectWebSocket(userId) {
-      let webSocket = new WebSocket(`ws://${this.$c.hostname}:8872/api/report/api/ws/`+userId)
-      // let webSocket = new WebSocket(`ws://192.168.1.24:8872/api/report/api/ws/`+userId)
+      // let webSocket = new WebSocket(`ws://${this.$c.hostname}:8872/api/report/api/ws/`+userId)
+      let webSocket = new WebSocket(`ws://${this.$c.hostname}:8877/api/v2/ws/`+userId)
       Store.commit('SET_WEB_SOCKET', webSocket)
       webSocket.onopen = () => {
         console.log('WebSocket连接成功')

+ 2 - 1
RMS-FrontEnd/src/views/report/components/CreateReport.vue

@@ -507,7 +507,8 @@ export default {
     },
     //websocket 后端发送信息
     initTask() {
-      var webSocket = new WebSocket(`ws://192.168.1.11:8877/api/v2/ws/328`)
+      // var webSocket = new WebSocket(`ws://192.168.1.11:8877/api/v2/ws/328`)
+      var webSocket =this.webSocket
       if(webSocket){
         webSocket.onmessage = (e) => {
         // console.log(e)