|
@@ -63,6 +63,7 @@ const user: Module<UserState, UserState> = {
|
|
|
state.userId = id
|
|
|
},
|
|
|
SET_MESSAGECOUNT: (state, num: Number) => {
|
|
|
+ console.log("TCL: num", num)
|
|
|
state.messageCount = num
|
|
|
},
|
|
|
SET_MESSAGE: (state, ms:any) => {
|
|
@@ -119,7 +120,7 @@ const user: Module<UserState, UserState> = {
|
|
|
commit('SET_USERID', res.user.userId)
|
|
|
|
|
|
|
|
|
- console.log("TCL: GetInfo -> wsManager1", this.wsManager)
|
|
|
+
|
|
|
if (this.wsManager) {
|
|
|
this.wsManager.closeConnection();
|
|
|
}else{
|
|
@@ -127,6 +128,7 @@ const user: Module<UserState, UserState> = {
|
|
|
const ms = new WebSocketManager(res.user.userId);
|
|
|
// 设置消息回调
|
|
|
ms.onMessage(data => {
|
|
|
+ console.log("处理消息逻辑", data.data)
|
|
|
// 处理消息逻辑
|
|
|
if (data.type === 'msgUnreadCount') {
|
|
|
commit('SET_MESSAGECOUNT', data.data);
|