From 6a9046adbdac502e3df63bbd8e196f4b1a7a585f Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Thu, 02 Dec 2021 10:14:52 +0800 Subject: [PATCH] 增加按钮可用颜色 --- common/Bridge.js | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/common/Bridge.js b/common/Bridge.js index 6664716..1f644ea 100644 --- a/common/Bridge.js +++ b/common/Bridge.js @@ -98,9 +98,16 @@ this[name] = (res) => { if (callback && Tools.isFunction(callback)) { if (res) { - let data = typeof res === 'string' ? JSON.parse(res) : res; - // 转换接收参数键名为驼峰 - data = this.transKeyName('camel', data); + let data; + try { + // 转对象 + data = typeof res === 'string' ? JSON.parse(res) : res; + // 转换接收参数键名为驼峰 + data = this.transKeyName('camel', data); + } catch (e) { + Tools.toast('跨端通讯异常:解析数据失败!'); + return; + } callback(data); } else { callback(); @@ -151,7 +158,6 @@ // 有通知回调 if (marker) { this._receives[method](param2, (param2) => { - debugger; this._sendTelling(method, param2 || {}, marker); }); } -- Gitblit v1.9.1