wx.login中通过http向后台传code值,网络请求失败

发布于 7 年前作者 kchang1776 次浏览最后编辑 7 年前来自 ask

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。


0 回复
暂无回复