微信公开课
如何看待微信公开课小程序热门讨论「小程序request问题」
摘要:小程序request问题
展开:第一次打开小程序request请求不成功,第二次打开小程可以访问成功模拟器上不会出现问题,真机上会有,不管是android还是ios,第一次错误提示:request:failurlnotindomainlist代码:wx.login({success:function(code){wx.getUserInfo({success:function(user){varuserCodcode.code;varnickNameuser.userInfo.nickNamewx.showModal({title:title,content:code+code.code+user+user.userInfo.nickName,showCancel:false,success:function(res){if(res.confirm){wx.request({url:http://.com/hepcws/v2/restws/,data:{appid:e5be52,secret:cb393a9de,js_code:userCod,nickName:nickName},method:POST,header:{contenttype:application/json},success:function(res){wx.showToast({title:success:+res,})that.setData({userInfo:user.userInfo})},fail:function(res){wx.showToast({title:fail+res.errMsg,})},complete:function(res){}})}}})}})}})了解更多