Преглед на файлове

产品相关专利userinfo找不到

zhuhao преди 2 години
родител
ревизия
f8ec025306
променени са 1 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. 8 3
      RMS-FrontEnd/src/views/product/components/relatedPatents/components/import/SystemTask.vue

+ 8 - 3
RMS-FrontEnd/src/views/product/components/relatedPatents/components/import/SystemTask.vue

@@ -124,7 +124,7 @@ export default {
   computed: {
     // ...mapGetters(['webSocket', 'userinfo'])
     userinfo() {
-      return this.$store.state.admin.userinfo
+        return this.$store.state.admin.userinfo
     }
 
   },
@@ -136,18 +136,23 @@ export default {
         this.getQueueList()
       }
     },
+    'userinfo.id'() {
+      this.connectWebSocket(this.userinfo.id)
+    }
   },
   mounted() {
     // this.queryParams.type = this.form
     this.getList()
    this.getQueueList()
     // this.initTask()
-    this.connectWebSocket(this.userinfo.id)
+    if (this.userinfo.id) {
+      this.connectWebSocket(this.userinfo.id)
+    }
   },
   methods: {
     connectWebSocket(userId) {
       this.webSocket1 = new WebSocket(`ws://139.224.24.90:8877/api/v2/ws/` + userId)
-      // this.webSocket1 = new WebSocket(`ws://192.168.1.24:8111/api/quartz/ws/` + userId)
+      // this.webSocket1 = new WebSocket(`ws://192.168.1.24:8877/api/v2/ws/` + userId)
 
       // Store.commit('SET_WEB_SOCKET', webSocket)
       this.webSocket1.onopen = () => {