有没有大佬救救我!这个我找了好多我都没搞明白咋回事!
wx.cloud.callFunction({
name: "login",
}).then(res => {
if (res.errMsg == "cloud.callFunction:ok") {
let _openid = res.result.openid;
let userInfo = e.detail.userInfo;
userInfo._openid = _openid;
User.login(userInfo).then(res => {
app.globalData.userInfo = res.userInfo;
wx.setStorageSync('userInfo', res.userInfo);
app.globalData.partnerInfo = res.partnerInfo;
wx.setStorageSync('partnerInfo', res.partnerInfo);
this.hello.show(userInfo.nickname);
}).catch((err) => {
wx.showModal({
title: '错误',
content: "网络异常[0]",
showCancel: false
});
console.log(err);
});
} else {
wx.showModal({
title: '错误',
content: "网络异常[1]",
showCancel: false
});
}
}).catch((code, msg) => {
console.log(code, msg);
wx.showModal({
title: '错误',
content: "网络异常[2]",
showCancel: false
});
});
查找下openid哪里出错了。
console.log(err);
});
} else {
wx.showModal({
title: '错误',
content: "网络异常[1]",
showCancel: false
});
}
}).catch((code, msg) => {
console.log(code, msg);
// 这上面这一行就是login.js:86
wx.showModal({
title: '错误',
content: "网络异常[2]",
showCancel: false
});
});