修正第一次进入页面无法获取用户资料的bug

This commit is contained in:
zhl 2019-03-05 20:44:59 +08:00
parent 4783be16b3
commit ee465fff75

View File

@ -133,6 +133,11 @@ export default class extends wepy.app {
}
}
getUserInfo() {
if (!this.globalData.userInfo) {
if (wepy.getStorageSync('userInfo')) {
this.globalData.userInfo = JSON.parse(wepy.getStorageSync('userInfo'));
}
}
return this.globalData.userInfo
}
checkAuthorize() {