diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 7dbfbb80b..ebc21bfd6 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -221,6 +221,8 @@ const socket = { permissionOver: {}, // 权限结束 + roomIsSubscribe:false, // 房间是否订阅 + tipOperateCount: 0, // 任务结束提示消息 realDeviceInfo: 0, // 真实设备信息 beLogoutCount: 0 // 被登出 @@ -276,6 +278,9 @@ const socket = { setRoomInvite: (state, roomInvite) => { state.roomInvite = roomInvite; + }, + setRoomSubscribe:(state, roomIsSubscribe)=>{ + state.roomIsSubscribe = roomIsSubscribe; } }, @@ -337,6 +342,9 @@ const socket = { pushMsgQueue: ({ commit }, msg) => { commit('pushMsgQueue', msg); + }, + setRoomSubscribe:({ commit }, msg) => { + commit('setRoomSubscribe', msg); } } }; diff --git a/src/utils/sock.js b/src/utils/sock.js index 1a9f43cd2..6ed81add9 100644 --- a/src/utils/sock.js +++ b/src/utils/sock.js @@ -149,7 +149,7 @@ StompClient.prototype = { if (subscription && subscription.sub) { subscription.sub.unsubscribe(); this.subscribeMap.delete(topic); - console.log('取消订阅'); + console.log('取消订阅:' + topic); } else if (subscription) { this.subscribeMap.delete(topic); } diff --git a/src/utils/stomp.js b/src/utils/stomp.js index 09cf86f95..413d53e60 100644 --- a/src/utils/stomp.js +++ b/src/utils/stomp.js @@ -4,6 +4,7 @@ import store from '@/store'; export const displayTopic = '/user/queue/simulation'; // 其他仿真topic export const perpetualTopic = '/user/topic/message'; // 公用topic +export const roomTopic = '/user/queue/room'; // 房间topic // 建立连接并订阅地址 export function creatSubscribe(topic, header) { diff --git a/src/views/jointTraining/index.vue b/src/views/jointTraining/index.vue index 60031a426..82ca762fe 100644 --- a/src/views/jointTraining/index.vue +++ b/src/views/jointTraining/index.vue @@ -26,6 +26,8 @@