提交 2deea6b5 编写于 作者: 郭胜强

fix:修复WebSocket事件监听报错的问题

上级 93af9929
...@@ -180,12 +180,16 @@ export function closeSocket (options, callbackId) { ...@@ -180,12 +180,16 @@ export function closeSocket (options, callbackId) {
/** /**
* 监听事件 * 监听事件
* @param {string} method * @param {string} method
* @param {Function} callback
*/ */
function on (method) { function on (method) {
return function (callback) { const {
invokeCallbackHandler: invoke
} = UniServiceJSBridge
return function (callbackId) {
if (socketTask) { if (socketTask) {
socketTask[method](callback) socketTask[method](function (res) {
invoke(callbackId, res)
})
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册