-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
wxGetSetting().then(res => {
if (res.authSetting['scope.userInfo']) {
wxGetUserInfo().then(res => {
that.globalData.nickName = res.userInfo.nickName;
that.globalData.userAvatar = res.userInfo.avatarUrl;
// 确认所需全局变量正常 否则重新登录获取
if (isAllStorageOk) {
that.globalData.isLogin = true;
}
if (that.globalData.uid != "") {
// put 更新用户信息
let url = `${that.globalData.commonUrl}/user/${that.globalData.uid}`
let data = res.userInfo;
let header = {
"content-type": "application/x-www-form-urlencoded",
"Authorization": `Bearer ${that.globalData.token}`
};
requestUtils.doPUT(url, data, header).catch(res => {
console.log("更新用户数据失败");
console.log(res);
});
}
});
}
app.js里设置that.globalData.isLogin = true是异步操作,如果首次打开在个人页面的话,isLogin在页面onShow是false的。没有及时更新
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels