|
|
@@ -160,7 +160,7 @@
|
|
|
requestTask = uni.request({
|
|
|
url: `${BaseApi}/core/chat/sendChatMessageStream`,
|
|
|
method: 'POST',
|
|
|
- timeout: 30000,
|
|
|
+ timeout: 20000,
|
|
|
data:{
|
|
|
query: this.question,
|
|
|
identity:'被教练者',
|
|
|
@@ -181,7 +181,7 @@
|
|
|
}
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
- if(err.errMsg.indexOf('time out')>-1||err.errMsg.indexOf('timeout')>-1) this.$showToast('请求超时,请稍后再试')
|
|
|
+ // if(err.errMsg.indexOf('time out')>-1||err.errMsg.indexOf('timeout')>-1) this.$showToast('请求超时,请稍后再试')
|
|
|
this._handleError(err.errMsg, resolve, reject);
|
|
|
},
|
|
|
complete: (com) => {
|
|
|
@@ -193,7 +193,12 @@
|
|
|
const uint8Array = new Uint8Array(res.data);
|
|
|
const decoder = new TextEncoding.TextDecoder("utf-8");
|
|
|
const decodedString = decoder.decode(uint8Array);
|
|
|
- console.log(decodedString,'decodedString',typeof decodedString);
|
|
|
+ if(decodedString.indexOf('"code":500')>-1){
|
|
|
+ const dsJson = JSON.parse(decodedString);
|
|
|
+ if(dsJson){
|
|
|
+ return this.$showModal(dsJson.msg||'')
|
|
|
+ }
|
|
|
+ }
|
|
|
try {
|
|
|
let newtext = decodedString.replaceAll('data:','').replaceAll(':keepAlive','');
|
|
|
let ntArr = newtext.split('\n\n');
|