feat: login rest
This commit is contained in:
@@ -12,7 +12,8 @@ Page({
|
||||
isLoading: false,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
hasMore: true
|
||||
hasMore: true,
|
||||
userInfo: null
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -23,6 +24,13 @@ Page({
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({ selected: 2 });
|
||||
}
|
||||
|
||||
// Update user info for header
|
||||
const app = getApp();
|
||||
const info = app.globalData.userInfo || wx.getStorageSync('userInfo');
|
||||
if (info) {
|
||||
this.setData({ userInfo: info });
|
||||
}
|
||||
},
|
||||
|
||||
// Called by create post page
|
||||
@@ -67,7 +75,7 @@ Page({
|
||||
return {
|
||||
id: item.id,
|
||||
user: publisher.nickName || publisher.name || '花友',
|
||||
avatar: avatarObj.url || '/assets/default_avatar.png',
|
||||
avatar: avatarObj.url,
|
||||
content: item.content,
|
||||
images: (item.imgList || []).map(img => img.url),
|
||||
time: item.createdAtStr || '刚刚',
|
||||
|
||||
Reference in New Issue
Block a user