From 2deea6b5305e82708cf23b4f25cd108692460c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E8=83=9C=E5=BC=BA?= Date: Thu, 29 Nov 2018 14:59:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8DWebSocket?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/service/api/network/socket.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/service/api/network/socket.js b/src/core/service/api/network/socket.js index 818fc83a94..b28a3c2481 100644 --- a/src/core/service/api/network/socket.js +++ b/src/core/service/api/network/socket.js @@ -180,12 +180,16 @@ export function closeSocket (options, callbackId) { /** * 监听事件 * @param {string} method - * @param {Function} callback */ function on (method) { - return function (callback) { + const { + invokeCallbackHandler: invoke + } = UniServiceJSBridge + return function (callbackId) { if (socketTask) { - socketTask[method](callback) + socketTask[method](function (res) { + invoke(callbackId, res) + }) } } } -- GitLab