Small program Local Test no problem, Apple Normal, Android cannot send the request, HTTPS SSL certificate is OK.
Page ({
data:{
Height:height,
Width:width,
},
Onload:function (options) {
Page initialization options are the parameters of the page jump
Wx.login ({
Success:function (loginres) {
Code = Loginres.code;
Wx.getuserinfo ({
Withcredentials:true,
Success:function (getuserinfores) {
Small program to determine if user account is bound
var data = {
EncryptedData:getuserinfores.encryptedData,
IV:GETUSERINFORES.IV,
Code:code,
Agencyid:agencyid,
}
Wx.request ({
url:apphost+ '/applet/login ',
Method: ' POST ',
DataType: ' JSON ',
Data:data,
Header: {
"Content-type": "application/x-www-form-urlencoded"
},
Success:function (res) {
Console.log (RES)
if (Res.data.code = = 200) {
Login successful, return user information and token, jump to homepage
Getapp (). Globaldata.wxuserinfo = Res.data.data;
App.globalData.interval = 0
GetData ()
SetTimeout (function () {
Wx.switchtab ({
URL: '/pages/index/index '
})
},1000)
}else if (Res.data.code = = 202) {
User account not bound
Getapp (). Globaldata.wxuserinfo = Res.data.data;
Console.log (Getapp (). Globaldata.wxuserinfo)
SetTimeout (function () {
Wx.redirectto ({
URL: '/pages/login/index '
})
},1000)
}else{
Console.log (RES.DATA.MSG)
}
},
Fail:function (res) {
Console.log (RES)
}
})
}
})
},
Fail:function () {
Wx.showtoast ({
Title: ' Failed login ',
Icon: ' Loadding ',
duration:2000
// })
// }
})
},
Onready:function () {
Page Rendering complete
},
Onshow:function () {
Page display
},
Onhide:function () {
Page Hide
},
Onunload:function () {
Page Close
}
})
Copy Code
Small program Local Test no problem, Apple Normal, Android can't send request?