Due to the single-instance version of the WebSocket, the onMessage response res contains only one layer of data. For compatibility with the online game, Taobao removed the extra layer of data (#17389)

This commit is contained in:
bofeng-song
2024-07-18 16:28:26 +08:00
committed by GitHub
parent ede81072aa
commit 2f4e6d3caa
@@ -42,8 +42,8 @@ export default class MultiWebSocket {
socketTask.onMessage((res) => {
if (typeof this.onmessage === 'function') {
if (res && res.data && res.data.data && res.data.isBuffer) {
res.data = _utils.base64ToArrayBuffer(res.data.data)
if (res && res.data && res.isBuffer) {
res.data = _utils.base64ToArrayBuffer(res.data)
}
this.onmessage(res)
}