模拟器请求接口正常,但真机调试失败
发布于 6 年前 作者 dengjun 11123 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
wx.request({
                                    url: PATHS.indentity,
                                    header: {
                                        'content-type': 'application/x-www-form-urlencoded'
                                    },
                                    data: {
                                        name: d.name,
                                        cardNo: d.cardNo,
                                        front: d.front,
                                        back: d.back,
                                        liveImage: d.liveImage,
                                        videoAuth: d.videoAuth,
                                        matchRate: d.matchRate
                                    },
                                    method: "POST",
                                    success: res => {
                                        console.log(res)
                                    }
                                })

这段代码在模拟器中能正常请求服务器接口,但编译后通过真机IPhone XS Max测试时,服务器接收到的请求参数的值均为“null”,请求参数中videoAuth为视频的base64编码,liveImage、front、back为图片的base64编码

  • 预期表现

正常发送请求参数的值

回到顶部