code is simple, as follows:
wx.request({
url: "https://......",
method: "GET",
header: {
"content-type": "application/x-www-form-urlencoded"
},
success: function (res) {
wx.showToast({
title: "success"
});
},
fail: function (res) {
wx.showToast({
title: "fail"
});
},
complete: function (res) {
wx.showToast({
title: "complete"
});
}
})
this code has no problem debugging on PC and can get the requested data. When debugging the real phone in the mobile phone Wechat, the request to return fail, immediately is noted immediately, without any delay. It seems that no request was made directly on fail at all.
however, if you "turn on debugging" in the mobile phone Wechat, you can send the request successfully.
what"s going on?
< hr > Update: solved.
the reason is unknown.
the solution is to play a game of PUBG and test it again when he comes back and be surprised to find out. Where is the cache? However, I have previously tried to clear the cache invalidation in the PC development tool.