wx.login中通过http向后台传code值,网络请求失败
发布于 6 年前 作者 kchang 1685 次浏览 来自 问答

wx.login({

    success: function (res) {

        if (res.code) {

        // console.log('发起网络请求:' + res.code)

            wx.request({

                url: 'https://test.com/onLogin'

                data: {

                    code: res.code

                }

            })

        }

    }

})


url用的是http协议,报错:net::ERR_CONNECTION_REFUSED。在控制台看到http协议变为了https。


回到顶部