util.request(api.haveSite, {
latitude: that.data.rlat,
longitude: that.data.rlon
}).then(res => {
if (res.code === 0) {
that.setData({
siteList: res.data
})
if (res.data.length == 0) {
that.setData({
noCar: true,
showWorkTime: false
})
that.getSystemInfo();
} else {
if ((res.data.findIndex(item => {
return item.siteId == wx.getStorageSync('loginInfo').siteId;
}) == -1) || app.globalData.hasLogin == false) {
if (res.data.length == 1) {
that.confim()
} else {
that.setData({
hideFlag: true
})
}
}
}
}
})
在onLoad中发起请求,请求无法进入.then中,打印不出res,服务端没问题,只有部分用户不正常

你这代码还不如不发,一点用都没有