onChunkReceived 在微信开发者工具能流式返回,为什么在真机就是一次性返回呀?
api:onChunkReceived 基础库 3.8.9 微信版本8.0.60 this.requestTask = wx.request({
url: 'https://xxxxxx',
enableChunked: true,
method: 'POST',
responseType: 'arraybuffer',
header: {
'content-type': 'application/json',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
Authorization: `Bearer ${this.data.token}`
},
data: {
question: message
}
})
this.requestTask.onChunkReceived((res) => {
console.log(res.data, 888)
const parsed = this.decodeUint8Array(res.data)
const temp = this.extractContentFromStream(parsed)
this.enqueueTyping(temp)
})
[图片] 真机就是一次性返回