fix:通知消息不更新问题

feature/im-0611-ch
ch 2 years ago
parent d04791081c
commit b96a231952

@ -147,7 +147,7 @@ export default {
return false;
}
// IM
ImInit().then((res) => {
ImInit().then(() => {
//
Im.getSessionList();
}).catch(e => {});

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 17:48:12
* @LastEditors: ch
* @LastEditTime: 2022-06-13 10:50:28
* @LastEditTime: 2022-06-13 11:49:37
* @Description: file content
-->
@ -65,7 +65,9 @@ export default {
},
computed: {
curSession(){
return this.$store.state.socketMsgData;
let data = this.$store.state.socketMsgData
Im.setCurSessionId(data.id);
return data;
},
msgData(){
let data = this.curSession.messageList || [];
@ -77,6 +79,7 @@ export default {
},
},
mounted() {
setTimeout(()=>{
this.readMsg();
},5000)
@ -109,6 +112,10 @@ export default {
}
}
},
destroyed(){
Im.setCurSessionId(null);
}
};
</script>
<style lang="scss" scoped>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-12 14:04:56
* @LastEditors: ch
* @LastEditTime: 2022-06-13 10:52:48
* @LastEditTime: 2022-06-13 11:48:41
* @Description: file content
*/
@ -39,8 +39,8 @@ export default ({store }) => {
let data = Im.sessionData.find(i => {
return (i.type === 4 && (typeof i.payload === 'string' ? JSON.parse(i.payload).type === 'system' : false));
}) || {}
console.log(data,'---');
let msgCount = data.unreadCount || 0;
Im.setCurSessionId(data.id);
store.commit('setSocketMsgData', JSON.parse(JSON.stringify(data)));
store.commit('setUnreadCount', msgCount);
}

Loading…
Cancel
Save