POST 403 forbidden
发布于 5 年前 作者 fliao 3371 次浏览 来自 问答

你想反馈一个 Bug 还是 提一个需求?

如果是 Bug:旧版开发者工具可以发出请求,但是新版请求失败

* Bug 表现是什么?预期表现是什么?

* 如何复现?

* 提供一个最简复现 Demo

var that = this
wx.login({
     success: function (res) {
       console.log("login, res is",res)
       if (res.code) {
         //发起网络请求
         wx.request({
           url: that.globalData.baseURL + '/login',
           method: 'POST',
           data: {
             code: res.code
           },
           success: function(res2){
             console.log('login res2 is: ',res2.data)
             that.globalData.expire = res2.data.expire
             that.globalData.token = res2.data.token
             that.globalData.uin = res2.data.userid
           }
         })
       } else {
         console.log('获取用户登录态失败!' + res2.errMsg)
       }
     }
   });
回到顶部