Commit fb03e418 authored by 武广's avatar 武广

fix: 修改IframeBridge方法

parent efb70eeb
/* eslint-disable class-methods-use-this */
class IframeBridge { class IframeBridge {
constructor() { constructor() {
console.info('use iframeBridge'); console.info('use iframeBridge');
this.mountEventBus(); this.mountEventBus();
} }
static run(data, callbackName) { run(data, callbackName) {
return new Promise(resolve => { return new Promise(resolve => {
if (!data.event) { if (!data.event) {
resolve(false); resolve(false);
...@@ -16,7 +17,7 @@ class IframeBridge { ...@@ -16,7 +17,7 @@ class IframeBridge {
}); });
} }
static mountEventBus() { mountEventBus() {
window.addEventListener('message', info => { window.addEventListener('message', info => {
// 来源页面地址 // 来源页面地址
console.log('addEventListenerCallBack', info); console.log('addEventListenerCallBack', info);
......
...@@ -74,7 +74,7 @@ const refreshRequest = async (url, options) => { ...@@ -74,7 +74,7 @@ const refreshRequest = async (url, options) => {
}; };
// 判断是否从tob进入 // 判断是否从tob进入
const iframeBridgeModel = IframeBridge(); const iframeBridgeModel = new IframeBridge();
const searchPrams = getUrlSearchParams(); const searchPrams = getUrlSearchParams();
const isTob = searchPrams.source === 'tob'; const isTob = searchPrams.source === 'tob';
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment