最近在写获取微信手机号,调用getphonenumber时,文档说先调用wx.login,那么wx.login在什么地方调用合适?
getPhoneNumber: function(e) { let that = this; console.log("e.info", e); if (e.detail.errMsg == 'getPhoneNumber:ok') { that.data.phoneEncryptedData = e.detail.encryptedData; that.data.phoneIV = e.detail.iv; wx.login({ success: function(res) { if (res.code) { // 通过code从自己服务器获取解密的手机号 that.getPhoneNumberInfo(res.code); } else { } } }); } }, |
循环地狱