wx.login没有响应,success,fail,complete都不走?
发布于 5 年前 作者 fang71 12106 次浏览 来自 官方Issues

老用户能正常使用,新用户所有机型,wx.login都不走

return new Promise(function (resolve, reject) {

     // 登录

     // console.log(this.globalData.openid)

     wx.login({

       success: res => {

         wx.request({

           url: util.baseurl + ‘getopenid’,

           data: {

             code: res.code

           },

           header: {},

           method: ‘GET’,

           dataType: ‘json’,

           responseType: ‘text’,

           success: function (res) {

             console.log(res);

             wx.setStorageSync(‘openid’, res.data.data.openid); //存储openid

             resolve(res.data);

           },

           fail: function (res) {

             // console.log(‘请求失败,openid:’ + that.globalData.openid)

           },

           complete: function (res) {

             //console.log(‘已执行,openid:’ + that.globalData.openid)            

           },

         })

       }

     })

   })

4 回复

不用看,都没进return所在函数

提供一下可复现的代码片段

我也遇到了,别人的账号在开发者工具,浏览,真机调试都能登录,只有我的账号用真机调试没反应,但是开发者工具和浏览、上线版都可以登录。。。。

我猜 你的代码写的有问题吧???

回到顶部