From 014479b8d11f7a0aabaaa2faabbc6acd615210a7 Mon Sep 17 00:00:00 2001 From: Sun_sun <469361609@qq.com> Date: Tue, 14 Oct 2025 13:25:54 +0800 Subject: [PATCH] =?UTF-8?q?2025-10-14=20=E5=8F=91=E9=80=81=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Chat.vue | 131 ++++++++++++++++++++++++++++----------------- 1 file changed, 82 insertions(+), 49 deletions(-) diff --git a/src/views/Chat.vue b/src/views/Chat.vue index b172e8c..227e78b 100644 --- a/src/views/Chat.vue +++ b/src/views/Chat.vue @@ -6,43 +6,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -107,16 +107,16 @@ - - - - - - - - - - + + + + + + + + + + 详情--> 进入聊天 - + @@ -279,7 +279,23 @@ :rows="3" placeholder="请输入消息..." > - 发送 + + + + 发送图片 + + + + 发送 + + @@ -302,6 +318,9 @@ import {io} from 'socket.io-client'; const {proxy} = getCurrentInstance(); const userStore = useUserStore() +const headers = { + Authorization: `Bearer ${userStore.token}` +} // 统计 const stats = ref({ @@ -557,6 +576,20 @@ const handleSendMsg = () => { inputText.value = '' } +const uploadSuccess = (res) => { + socket.value.emit('clientMsg', { + groupId: params.value.groupId, + createId: userStore.user.id, + content: res.data.url, + type: 'img' + }) +} + +const uploadError = (res) => { + const result = JSON.parse(res.message) + ElMessage.error(result.message) +} + // 头像字 const getRoleInitial = (createId) => { if (messageUserId.value === createId) {