原始数据[70, 76, 86, 1, 5, 0, 0, 0, 9, 0, 0, 0, 0, 18, 0, 1, 136, 0, 0, 0, 0, 0, 0, 0, 2, 0, 10, 111, 110, 77, 101, 116, 97, 68, 97, 116, 97, 3, 0, 5, 119, 105, 100, 116, 104, 0, 64, 132, 0, 0, 0, 0, 0, 0, 0, 6, 104, 101, 105, 103, 104, 116, 0, 64, 118, 128, 0, 0, 0, 0, 0, 0, 13, 118, 105, 100, 101, 111, 100, 97, 116, 97, 114, 97, 116, 101, 0, 64, 130, 174, 162, 0, 0, 0, 0, 0, 9, 102, 114, 97]
接收到的数据 [70, 76, 86, 1, 5, 0, 0, 0, 9, 0, 0, 0, 0, 18, 0, 1, 253, 0, 0, 0, 0, 0, 0, 0, 2, 0, 10, 111, 110, 77, 101, 116, 97, 68, 97, 116, 97, 3, 0, 5, 119, 105, 100, 116, 104, 0, 64, 253, 0, 0, 0, 0, 0, 0, 0, 6, 104, 101, 105, 103, 104, 116, 0, 64, 118, 253, 0, 0, 0, 0, 0, 0, 13, 118, 105, 100, 101, 111, 100, 97, 116, 97, 114, 97, 116, 101, 0, 64, 253, 253, 253, 0, 0, 0, 0, 0, 9, 102, 114, 97]
超过128的数据都直接变成253
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
const requestTask = wx.request({ url: "xxx", method: "get", header: { // 'Content-Type': 'application/x-www-form-urlencoded', }, responseType: 'arraybuffer', enableChunked:true, success: function(res) { console.log("success",res) }, fail: function(res){ console.log("fail",res) }, complete:function(res){ console.log("complete",res); } }); requestTask.onChunkReceived((res) => { let value = new Uint8Array(res.data); console.log(value); }); 执行request,onChunkReceived返回的数据和原始数据不一致,取到的数据大于128的字节全部变成了253 /** * [70, 76, 86, 1, 5, 0, 0, 0, 9, 0, 0, 0, 0, 18, 0, 1, 253, 0, 0, 0, 0, 0, 0, 0, 2, 0, 10, 111, 110, 77, 101, 116, 97, 68, 97, 116, 97, 3, 0, 5, 119, 105, 100, 116, 104, 0, 64, 253, 0, 0, 0, 0, 0, 0, 0, 6, 104, 101, 105, 103, 104, 116, 0, 64, 118, 253, 0, 0, 0, 0, 0, 0, 13, 118, 105, 100, 101, 111, 100, 97, 116, 97, 114, 97, 116, 101, 0, 64, 253, 253, 253, 0, 0, 0, 0, 0, 9, 102, 114, 97, …]