From 97639e79645eac9ef843f5375f30f25ae6b169e4 Mon Sep 17 00:00:00 2001 From: ch Date: Mon, 13 Jun 2022 17:01:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/chat/index.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index 6635a61..5cc2f24 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -320,6 +320,10 @@ }; const handleSendImage = async (e) => { const file = e.target.files[0]; + if (!file.type.includes('image')) { + proxy.$message.warning('只能发送图片哦~'); + return false; + } e.target.value = null; let url = await upload('mall-product', 'im/', file); const curService = store.state.chat.curCustomerService; @@ -342,6 +346,10 @@ }; const handleSendVideo = async (e) => { const file = e.target.files[0]; + if (!file.type.includes('video')) { + proxy.$message.warning('只能发送视频哦~'); + return false; + } e.target.value = null; let url = await upload('mall-product', 'im/', file); // store.dispatch('chat/submitVideo', { url });