Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.onJsBridgeReady 回调好多次怎么破? #35

Open
MaXiaopingIT opened this issue Sep 6, 2021 · 1 comment
Open

window.onJsBridgeReady 回调好多次怎么破? #35

MaXiaopingIT opened this issue Sep 6, 2021 · 1 comment

Comments

@MaXiaopingIT
Copy link

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)
// })
}

@pengwei1024
Copy link
Owner

你说 onJsBridgeReady 方法回调多次吗?还是 getCurrentUser ?前者的话可以用全局变量控制下,后者得看端上是不是多次调用了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants