minor fix

huangjinysf 4 months ago
parent b454801f9d
commit fcf352d25a

@ -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 = [
'好的,我已经为您处理。', '好的,我已经为您处理。',

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save