wx.getStorage({ key: 'userInfo',
success (res) {
tools.showToast('成功',res)
that.userInfo = res.data;
that.getOpenId()
},
fail (err) {
tools.showToast('失败',err)
wx.getUserProfile({
desc: '正在获取', //不写不弹提示框
success: function (res) {
that.userInfo = res.userInfo;
wx.setStorage({ key: 'userInfo', data: res.userInfo });
that.getOpenId()
},
fail: function (err) {
console.log("获取失败: ", err)
}
})
}
});