Open MaXiaopingIT opened 3 years ago
console.log("window.onJsBridgeReady = function () {") window.onJsBridgeReady = function () { console.log("window.onJsBridgeReady") JsBridge.mp.getCurrentUser({ success: data => { console.log("JsBridge.mp.getCurrentUser") console.log(data) // resolve(JSON.parse(data)) }, error: (err) => { console.log(err) // reject(err) } }) // mp.getCurrentUser().then(res=>{ // console.log("返回的东西") // console.log(res) // }) }
你说 onJsBridgeReady 方法回调多次吗?还是 getCurrentUser ?前者的话可以用全局变量控制下,后者得看端上是不是多次调用了
console.log("window.onJsBridgeReady = function () {") window.onJsBridgeReady = function () { console.log("window.onJsBridgeReady") JsBridge.mp.getCurrentUser({ success: data => { console.log("JsBridge.mp.getCurrentUser") console.log(data) // resolve(JSON.parse(data)) }, error: (err) => { console.log(err) // reject(err) } }) // mp.getCurrentUser().then(res=>{ // console.log("返回的东西") // console.log(res) // }) }