你想反馈一个 Bug 还是 提一步知道
不知道大家有没遇到这种情况,web-view在ios可以正常访问所有Android都能打开-微信小程序开发。请求是成功了,但是所有的回调都没收到
这个是出问题的代码
function getWechatOpenid(session) {
var targetUrl = URL.getWechatOpenId + '?code=' + session
console.log("getWechatOpenid:" + targetUrl)
wx.request({
url: targetUrl,
success: function (res) {
console.log(res)
},
fail: function (err) {
failCallback('获取openid错误')
},
complete: function (res) {
console.log(res)
}
})
}
这个是控制台打印的数据:
checkSession:null
user.js? [sm]:26 wxLogin:071icKRt1GOZ5c0KMyTt1yLvRt1icKR-
user.js? [sm]:38 getWechatOpenid:https://uicole.com/social/getWechatOpenId?code=071icKRt1GOZ5c0KMyTt1yLvRt1icKR-
从报文可以看出所有的请求回调都没有收到,正常应该打印出返回的数据
查看network频道,发现是请求成功的,并且成功返回了数据
headers:
Request URL:
https://uicole.com/social/getWechatOpenId?code=071icKRt1GOZ5c0KMyTt1yLvRt1icKR-
Request Method:
GET
Status Code:
200 OK
Remote Address:
121.40.23.229:443
Referrer Policy:
no-referrer-when-downgrade
Response Headersview source
Access-Control-Allow-Origin:
*
Connection:
Keep-Alive
Content-Type:
application/json
Date:
Thu, 04 Jan 2018 15:59:36 GMT
Keep-Alive:
timeout=5, max=100
Server:
Apache/2.2.22 (Ubuntu)
Transfer-Encoding:
chunked
X-Frame-Options:
SAMEORIGIN
Request Headersview source
Accept:
*/*
Accept-Encoding:
gzip, deflate, br
Cache-Control:
no-cache
Connection:
keep-alive
content-type:
application/json
Host:
uicole.com
Pragma:
no-cache
Referer:
https://servicewechat.com/wx1d3f6f2584ac9650/devtools/page-frame.html
User-Agent:
wechatdevtools appservice port/9974
这个是previe频道
{msg: "", code: "00", data: "oOY_-0DG3VKtt9SVUIR7M2CBLsQQ"}
这个是response频道
{"msg": "", "code": "00", "data": "oOY_-0DG3VKtt9SVUIR7M2CBLsQQ"}
这个问题我调试很久了,只出现在苹果笔记本上,windows上是好的,请大家指教下
本文网址:http://www.91bianli.com/kaifazhinan/72575.html