:sparkles:新增聊天功能

This commit is contained in:
不做码农
2023-09-27 18:26:36 +08:00
parent e6f98d4a2d
commit c1bfaabcb2
8 changed files with 320 additions and 38 deletions
+5 -4
View File
@@ -51,18 +51,19 @@ export default {
})
// 接收聊天数据
connection.on('receiveChat', (data) => {
const title = `来自${data.userName}的消息通知`
const { fromUser, message } = data
useSocketStore().setChat(data)
if (data.userid != useUserStore().userId) {
ElNotification({
title: title,
message: data.message,
title: fromUser.nickName,
message: message,
type: 'success',
duration: 3000
})
}
webNotify({ title: title, body: data.message })
webNotify({ title: fromUser.nickName, body: message })
})
connection.on('onlineInfo', (data) => {