使用getUserProfile导致的登录失败,而且反复弹出请先重新登录?急急急,有无大佬帮忙看看
首先看看错误信息: [图片] 上面报错的代码(涉及getUserProfile的代码) loginAfter: function(e) {
var o;
wx.getUserProfile ? (o = getApp(), wx.getUserProfile({
lang: "zh_CN",
desc: "用于登陆",
success: function(e) {
console.log(e), wx.setStorageSync("wxInfo", e), o.checkLogin(e);
},
fail: function(e) {
console.log(e);
}
})) : wx.showModal({
title: "登录出现错误",
content: "请升级至微信最新版本,以便为您提供最优服务",
success: function(e) {}
});
},
登录一直出现这个界面: [图片] 这个界面的代码(也就是报错信息undefined的代码): util.message = function(e, t, n) {
if (!e) return !0;
var a, r, o;
"object" == (void 0 === e ? "undefined" : _typeof(e)) && (t = e.redirect, n = e.type,
e = e.title), t && (a = t.substring(0, 9), o = r = "", "navigate:" == a ? (o = "navigateTo",
r = t.substring(9)) : "redirect:" == a ? (o = "redirectTo", r = t.substring(9)) : (r = t,
o = "redirectTo")), console.log(r), "success" == (n = n || "success") ? wx.showToast({
title: e,
icon: "success",
duration: 2e3,
mask: !!r,
complete: function() {
r && setTimeout(function() {
wx[o]({
url: r
});
}, 1800);
}
}) : "error" == n && wx.showModal({
title: "系统信息",
content: e,
showCancel: !1,
confirmColor: "#f43f6c",
cancelColor: "#f43f6c",
confirmText: "我知道了",
complete: function() {
r && ("back" == r ? wx.navigateBack() : "index" == r ? wx.switchTab({
url: "/first_duoduoke/pages/index/index"
}) : "task" == r ? wx.switchTab({
url: "/first_duoduoke/pages/task/task"
}) : wx[o]({
url: r
}));
}
});
},