|
@@ -398,13 +398,13 @@ const sendMessage = () => {
|
|
|
};
|
|
|
|
|
|
// 发送图片消息
|
|
|
-const afterRead = async (file) => {
|
|
|
+const afterRead = async (file) => {
|
|
|
const arrayBuffer = await file.file.arrayBuffer();
|
|
|
const message = {
|
|
|
content: text.value, // 如果有文本内容
|
|
|
contentType: MSG_TYPE.IMAGE, // 音频消息类型
|
|
|
messageType: MESSAGE_TYPE_USER, // 单聊消息
|
|
|
- fileSuffix: file.type, // 使用webm后缀更准确
|
|
|
+ fileSuffix: file.file.type, // 使用webm后缀更准确
|
|
|
file: new Uint8Array(arrayBuffer), // 将Uint8Array转为普通数组
|
|
|
};
|
|
|
|