This commit is contained in:
许允枞 2025-03-10 15:10:08 +08:00
parent a6a14e8ebb
commit d9fa16c70a
3 changed files with 768 additions and 675 deletions

View File

@ -370,7 +370,6 @@ export default {
msgInfo() {
if (this.msgSocket) {
this.msgSocket.onMessage(res => {
console.log('this.messagesList', this.messagesList[this.messagesList.length - 1])
if (this.info.conversation == 'Translator') {
if (this.messagesList[this.messagesList.length - 1].inputs.type != 'image') {
this.messagesList[this.messagesList.length - 1].answer = this.messagesList[this
@ -411,7 +410,6 @@ export default {
this.goBottom()
}
}
console.log('this.messagesList', this.messagesList)
})
@ -564,7 +562,6 @@ export default {
'type': '',
'filePath': inputData.filePath,
};
console.log(msgItem)
if (this.info.conversation == 'Translator') {
msgItem.response_mode = 'blocking'
msgItem.inputs.lang = this.lang
@ -597,22 +594,30 @@ export default {
'answer': '',
'socketId': this.socketId,
};
console.log(this.info.conversation, 259)
if (this.info.conversation == 'Translator') {
requestData.response_mode = 'blocking'
requestData.inputs.lang = this.lang
requestData.inputs.sayLang = this.sayLang
} else if (this.info.conversation == 'Trip') {
// requestData.query = ""
// requestData.inputs = {}
// requestData.files = [
// {
// "type": "image",
// "transfer_method": "local_file",
// "url": '',
// "upload_file_id": inputData.message
// }
// ]
if (requestData.inputs.type == 'image') {
requestData.query = "描述图片"
// requestData.inputs = {}
requestData.files = [
{
"type": "image",
// "type": "image/jpeg",
"transfer_method": "local_file",
"url": '',
"upload_file_id": inputData.message
}
]
}
setTimeout(() => {
sendMsg(that.msgSocket, JSON.stringify(requestData))
requestData.query = inputData.base64
}, 500)
return
}
setTimeout(() => {
sendMsg(that.msgSocket, JSON.stringify(requestData))
@ -665,8 +670,9 @@ page {
.po_i {
position: absolute;
//top: -60px;
left: 0px;
top: -55px;
box-sizing: border-box;
padding: 10px;
height: 50px;
@ -760,6 +766,7 @@ page {
padding: 18rpx 24rpx;
white-space: pre-wrap;
word-wrap: break-word;
position: relative;
}
.msg-img {

View File

@ -223,7 +223,22 @@ export default {
//res.datajson
let json = JSON.parse(res.data)
console.log(json.id,'上传图片返回结果')
that.send(json.id, 1, res.data)
upload({
filePath: tempFilePaths[0],
url: 'base64Api/upload',
name: 'file',
}).then(res1 => {
request({
url: 'base64Api/inputBase64',
method: 'post',
data: {
base64: res1.base64
}
}).then(res2 => {
that.send(json.id, 1, res1.base64)
})
})
// that.send(json.id, 1, res.data)
},
fail: (err) => {
console.log(err,'上传报错')

File diff suppressed because it is too large Load Diff