|
|
|
@ -222,7 +222,9 @@
|
|
|
|
const uploadRes = await new Promise((resolve, reject) => {
|
|
|
|
const uploadRes = await new Promise((resolve, reject) => {
|
|
|
|
uni.uploadFile({
|
|
|
|
uni.uploadFile({
|
|
|
|
// url: 'http://192.168.133.83:8000/recognize_speech',
|
|
|
|
// url: 'http://192.168.133.83:8000/recognize_speech',
|
|
|
|
url: 'http://192.168.10.44:8000/recognize_speech',
|
|
|
|
// url: 'http://192.168.10.44:8000/recognize_speech',
|
|
|
|
|
|
|
|
// url: 'http://192.168.1.18:8000/recognize_speech',
|
|
|
|
|
|
|
|
url: 'http://106.227.91.181:8000/recognize_speech',
|
|
|
|
filePath: tempFilePath,
|
|
|
|
filePath: tempFilePath,
|
|
|
|
name: 'speech', // 对应后端的 UploadFile 参数名
|
|
|
|
name: 'speech', // 对应后端的 UploadFile 参数名
|
|
|
|
formData: {
|
|
|
|
formData: {
|
|
|
|
@ -356,8 +358,8 @@
|
|
|
|
async getAIResponse(message){
|
|
|
|
async getAIResponse(message){
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// const url = 'http://192.168.133.83:9020/api/chat'
|
|
|
|
// const url = 'http://192.168.133.83:9020/api/chat'
|
|
|
|
const url = 'http://192.168.10.44:9020/api/chat'
|
|
|
|
// const url = 'http://192.168.10.44:9020/api/chat'
|
|
|
|
// const url = 'http://106.227.91.181:9020/api/chat' // 如需切换线上,改这里即可
|
|
|
|
const url = 'http://106.227.91.181:9020/api/chat' // 如需切换线上,改这里即可
|
|
|
|
const headers = { 'Content-Type': 'application/json' }
|
|
|
|
const headers = { 'Content-Type': 'application/json' }
|
|
|
|
const data = { message }
|
|
|
|
const data = { message }
|
|
|
|
|
|
|
|
|
|
|
|
@ -637,17 +639,20 @@
|
|
|
|
this.typewriterTimers[messageId] = timer
|
|
|
|
this.typewriterTimers[messageId] = timer
|
|
|
|
},
|
|
|
|
},
|
|
|
|
scrollToBottom() {
|
|
|
|
scrollToBottom() {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
let self = this;
|
|
|
|
uni.createSelectorQuery().select('.content').boundingClientRect((rect) => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
uni.pageScrollTo({
|
|
|
|
uni.createSelectorQuery().select('.content').boundingClientRect((rect) => {
|
|
|
|
scrollTop: rect.height,
|
|
|
|
if(self.height !== rect.height){
|
|
|
|
duration: 300,
|
|
|
|
self.height = rect.height;
|
|
|
|
class: '.content'
|
|
|
|
uni.pageScrollTo({
|
|
|
|
});
|
|
|
|
scrollTop: rect.height,
|
|
|
|
}).exec();
|
|
|
|
duration: 300,
|
|
|
|
})
|
|
|
|
class: '.content'
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
}).exec();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
mockReply(text) {
|
|
|
|
mockReply(text) {
|
|
|
|
const candidates = [
|
|
|
|
const candidates = [
|
|
|
|
'好的,我已经为您处理。',
|
|
|
|
'好的,我已经为您处理。',
|
|
|
|
|