Commit 119f1481 by qlintonger xeno

眼镜端修复+2

parent e63942da
......@@ -333,15 +333,24 @@ export class AgoraHandle {
case 'Image':
case 'File':
{
console.log('收到ws眼镜端消息点', msgData)
console.log('收到ws眼镜端消息点', msgData);
if (msgData.msgData.msgId) {
break
}
const msgType = msgData.msgData.tip.endsWith('.mp4') ? 'ChatVideo' :
['.jpg', '.png', '.jpeg'].some(a=>msgData.msgData.tip.endsWith(a)) ? 'ChatImage' :
'ChatFile'
const msgDataWhich = {
tip: {
fileSize: 0,
fileType: msgType === 'ChatVideo' ? 'video' : msgType === 'ChatImage' ? 'image' : 'file',
fileUrl: msgData.msgData.tip,
fileName: msgData.msgData.tip.slice(msgData.msgData.tip.lastIndexOf('/') + 1)
},
msgId: generateMessageId(),
quoteId: '',
fromName,
channelID: chatChannelState.value.chatChannelId
}
this.AnyRemote.sendRaw(
fromID, fromName, msgType, msgDataWhich, chatChannelState.value.chatChannelId, '-2'
......@@ -421,6 +430,7 @@ export class AgoraHandle {
}
sendTextInChatRoom(text) {
const msgId = generateMessageId()
this.AnyRemote.sendWSFromCall(
'-2',
'ChatTxt',
......@@ -429,14 +439,16 @@ export class AgoraHandle {
quoteId: '',
channelID: chatChannelState.value.chatChannelId,
fromName: userStates.value.currentUserName,
msgId: generateMessageId()
msgId
}
)
this.AnyRemote.sendWSFromCall(
'-2',
'Txt',
{
tip: text,
channelID: chatChannelState.value.chatChannelId,
msgId
}
)
}
......@@ -444,10 +456,11 @@ export class AgoraHandle {
sendImage(data) {
const channelID = chatChannelState.value.chatChannelId;
const fromName = userStates.value.currentUserName
const msgId = generateMessageId()
this.AnyRemote.sendWSFromCall(
'-2',
'ChatImage', {
msgId: generateMessageId(),
msgId,
quoteId: "",
channelID,
fromName,
......@@ -464,7 +477,8 @@ export class AgoraHandle {
'Image',
{
tip: data.fileUrl,
channelID
channelID,
msgId
}
)
}
......@@ -472,10 +486,11 @@ export class AgoraHandle {
sendFile(data) {
const channelID = chatChannelState.value.chatChannelId;
const fromName = userStates.value.currentUserName
const msgId = generateMessageId()
this.AnyRemote.sendWSFromCall(
'-2',
'ChatFile', {
msgId: generateMessageId(),
msgId,
quoteId: "",
channelID,
fromName,
......@@ -492,7 +507,8 @@ export class AgoraHandle {
'File',
{
tip: data.fileUrl,
channelID
channelID,
msgId
}
)
}
......@@ -500,8 +516,9 @@ export class AgoraHandle {
sendVideo(data, fileType = 'video') {
const channelID = chatChannelState.value.chatChannelId;
const fromName = userStates.value.currentUserName
const msgId = generateMessageId()
const md = {
msgId: generateMessageId(),
msgId,
quoteId: "",
channelID,
fromName,
......@@ -521,7 +538,8 @@ export class AgoraHandle {
'File',
{
tip: data.fileUrl,
channelID
channelID,
msgId
}
)
}
......
......@@ -106,7 +106,7 @@ const uploadMuFile = (option: any, type: string) => {
if (res.code == 200) {
console.log('发送内容', res)
const dataFormed = {
fileUrl: res.data.url,
fileUrl: res.data.oURL,
fileName: res.data.name,
fileSize: Number.parseInt(res.data.size),
fileType: type
......@@ -136,6 +136,7 @@ function convertURL(string: string) {
}
const mapChatMessageQueue = computed(function () {
console.log('mq here', chatChannelState.value.messageQueue)
return chatChannelState.value.messageQueue.map(function (a: any) {
return {
isSelf: a.uid === userStates.value.currentUserId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment