|
@@ -70,7 +70,7 @@
|
|
import ChatMessage from './components/chat-message'
|
|
import ChatMessage from './components/chat-message'
|
|
import ChatInput from './components/chat-input'
|
|
import ChatInput from './components/chat-input'
|
|
import { findHyperlinks } from '~/pages/chat/components/chat-message/link-message/handle'
|
|
import { findHyperlinks } from '~/pages/chat/components/chat-message/link-message/handle'
|
|
-import { XYWebSocket } from '~/utils/XYWebSocket'
|
|
|
|
|
|
+import {SocketEventsBus, XYWebSocket} from '~/utils/XYWebSocket'
|
|
import { isValidJson } from '~/utils'
|
|
import { isValidJson } from '~/utils'
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
@@ -288,8 +288,7 @@ function getLocalId() {
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
initGroupId()
|
|
initGroupId()
|
|
|
|
|
|
- try {
|
|
|
|
- XYWebSocket.SocketEventsBus.on(XYWebSocket.SocketEvents.chatEvent, async (chat) => {
|
|
|
|
|
|
+ XYWebSocket.SocketEventsBus.on('chat-event', async (chat) => {
|
|
console.log('订阅群聊消息', chat)
|
|
console.log('订阅群聊消息', chat)
|
|
const isCurrGroupId = chat.groupId && chat.groupId === groupId.value
|
|
const isCurrGroupId = chat.groupId && chat.groupId === groupId.value
|
|
const isOtherUserMessage = chat.sendUserId && chatsStore.isRealMessage(chat.sendUserId)
|
|
const isOtherUserMessage = chat.sendUserId && chatsStore.isRealMessage(chat.sendUserId)
|
|
@@ -303,9 +302,7 @@ onMounted(() => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- } catch (error) {
|
|
|
|
- console.log(error, '--------------error-----------')
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
|
|
|
|
// 查寻群公告
|
|
// 查寻群公告
|