|
@@ -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 = () => {
|