WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2021-12-28 4b4a160812ba96e24b6d8faeae2b3d2adb0157d3
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);
                    });
                }