forked from mfay/IOReportMgt
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
693 B
31 lines
693 B
import { BASE_URL } from '../../utils/util';
|
|
|
|
Page({
|
|
data: {
|
|
userInfo: {}
|
|
},
|
|
onShow() {
|
|
this.loadUserInfo();
|
|
},
|
|
// 获取用户信息
|
|
loadUserInfo: async function () {
|
|
let json = wx.getStorageSync('SYS_USER_INFO');
|
|
console.log(json);
|
|
|
|
if (json) {
|
|
// 从缓存中获取
|
|
this.setData({
|
|
userInfo: json
|
|
});
|
|
} else {
|
|
// 从服务器中获取
|
|
// let res:any = await service.API.user.getCurrentUser.request();
|
|
// let userInfo = res && typeof res.data === 'object' ? res.data : {};
|
|
|
|
// wx.setStorageSync('SYS_USER_INFO', userInfo);
|
|
// this.setData({
|
|
// userInfo: userInfo
|
|
// });
|
|
}
|
|
}
|
|
}) |