From cc569c8a6f93e9dd78156fbef25f517c6219585d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Wed, 24 Sep 2025 16:37:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9B=20=E8=B0=83=E6=95=B4=E6=BC=94?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 6 +++--- src/api/common.js | 3 ++- src/pages/example/components/answer.vue | 14 +++++++++++--- src/pages/example/dialog.vue | 8 +++++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.env.development b/.env.development index 2186b910..ee215ad6 100644 --- a/.env.development +++ b/.env.development @@ -19,11 +19,11 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # h5专用地址x2 -#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' -# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.92:9786' +# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786' # VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' - VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' +# VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' # VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605' diff --git a/src/api/common.js b/src/api/common.js index 79105795..e98d8ae2 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -86,9 +86,10 @@ export const commonUploadVoiceFile = (file, url, data = {}, fileKey = 'voice') = filePath: file, name: fileKey, formData: data, - timeout: 6000, + timeout: 60000, success(result) { try { + console.log(result) const res = JSON.parse(result.data); if (res.rtnCode === '0000') { return resolve(res); diff --git a/src/pages/example/components/answer.vue b/src/pages/example/components/answer.vue index 054b9b4c..49b74e01 100644 --- a/src/pages/example/components/answer.vue +++ b/src/pages/example/components/answer.vue @@ -11,9 +11,17 @@ - 大模型请求时长:{{ dataInfo.aiAskTime }}ms - 生成语音文件时长:{{ dataInfo.transVoice }}ms - 本次回答参考资料来源于网络 + 语音转文字的耗时:{{ dataInfo.asrTime }}ms + + 请求内容的字符长度:{{ dataInfo.reqContSize }} + + AI问答返回内容字符的长度:{{ dataInfo.aiContentSize }} + AI问答总耗时:{{ dataInfo.aiAskTime }}ms + 文字转语音消耗时长:{{ dataInfo.transVoice }}ms + + 上传OSS文件服务消耗时长:{{ dataInfo.ossUpTime }}ms + AI回答语音长度时长:{{ dataInfo.playVoiceTime }}s + diff --git a/src/pages/example/dialog.vue b/src/pages/example/dialog.vue index aeea75c5..83657bf9 100644 --- a/src/pages/example/dialog.vue +++ b/src/pages/example/dialog.vue @@ -350,12 +350,13 @@ }); scrollToBottomNow() chatVoice({ - chatVoice: data.body.intrctContent + chatVoice: data.body.intrctContent, + asrTime: data.body.asrTime || 0 }).then(res => { talkingList.value.pop() talkingList.value.push({ type: 'answer', - talkingText: res.body.content, + talkingText: res.body.aiContent, isLoading: false, id: _id + 'a', talkingFiles: [], @@ -614,7 +615,8 @@ intrctContent: _res.body.transContent, bucketKey: _res.body.fileId, ossFileAddr: _res.body.ossFileAddr, - talkingVoice: voicePath + talkingVoice: voicePath, + asrTime: _res.body.asrTime || 1000 }; sendMessage({ commond: 'ASK',