浏览代码

产品相关专利userinfo找不到

zhuhao 2 年之前
父节点
当前提交
f8ec025306

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

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