From e08a84b8504f8809fff596fef56f8a7e52a60627 Mon Sep 17 00:00:00 2001 From: ch Date: Tue, 14 Jun 2022 15:47:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B6=88=E6=81=AF=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/chat/chat.js | 2 +- src/views/chat/index.vue | 5 +++-- src/views/chat/message.vue | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/store/modules/chat/chat.js b/src/store/modules/chat/chat.js index f7f24ad..8edd291 100644 --- a/src/store/modules/chat/chat.js +++ b/src/store/modules/chat/chat.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-06-07 15:41:05 * @LastEditors: ch - * @LastEditTime: 2022-06-14 14:59:41 + * @LastEditTime: 2022-06-14 15:26:44 * @Description: file content */ import * as api from '@/api/chat'; diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index eeda704..30254be 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -146,13 +146,14 @@ const store = useStore(); store.dispatch('chat/queryCurCustomerService'); const socketInit = () => { - if (!store.state.chat.curCustomerService.waiterId) { + let waiterId = store.state.chat.curCustomerService.waiterId; + if (!waiterId) { setTimeout(() => { socketInit(); }, 1000); return false; } - ImInit(store.state.chat.curCustomerService.waiterId).then(() => { + ImInit(waiterId).then(() => { Im.getSessionList(); }); }; diff --git a/src/views/chat/message.vue b/src/views/chat/message.vue index b60ec27..343e8d5 100644 --- a/src/views/chat/message.vue +++ b/src/views/chat/message.vue @@ -4,7 +4,7 @@ :class="{ [`--${messageType[props.message.type]}`]: true, '--notify': messageType[props.message.type] === 'custom' && content.type === 'transferWaiterSession', - '--self': props.message.fromId !== props.session.fromId, + '--self': props.message.fromId == $store.state.chat.curCustomerService.waiterId, }" >