<button wx:if="{{ !isLogin }}" class="btn" type="primary" open-type="getPhoneNumber" bind:getphonenumber="handleOneClickLogin">一键登录</button>
handleOneClickLogin(e) {
console.log(e,'e');
if (e.detail.code) {
wx.login({
success: async (res) => {
console.log(res,'res');
const data = await userAppletPhoneLogin({
code: e.detail.code,
jsCode: res.code
})
if (data.msg) {
wx.showToast({
title: data.msg,
icon: 'none'
})
return
}
wx.setStorageSync('userInfo', {
...data,
login_code:e.detail.code,
jsCode: res.code
})
this.setData({
isLogin: true
})
this.getData()
}
})
}
},
为什么我在本地调试调用handleOneClickLogin方法能生效,但发布到线上就不生效

在正式版打开调试还有一种方法,就是先在开发版或体验版打开调试,再切到正式版就能看到vConsole