mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Since the online game is already using the Taobao API, it needs to be adapted by the engine. (#17406)
* Revert "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 reverts commit 2f4e6d3caa.
* Since the online game is already using the Taobao API, it needs to be adapted by the engine.
This commit is contained in:
@@ -42,8 +42,9 @@ export default class MultiWebSocket {
|
||||
|
||||
socketTask.onMessage((res) => {
|
||||
if (typeof this.onmessage === 'function') {
|
||||
if (res && res.data && res.isBuffer) {
|
||||
res.data = _utils.base64ToArrayBuffer(res.data)
|
||||
if (res && res.data && res.data.data && res.data.isBuffer) {
|
||||
res.isBuffer = res.data.isBuffer;
|
||||
res.data = _utils.base64ToArrayBuffer(res.data.data);
|
||||
}
|
||||
this.onmessage(res)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user