diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 0f6132f..56ea6c8 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -30,17 +30,19 @@ Page({ onLoad: function() { var that = this - if (app.globalData.token) { - profile.getCustomerInfo({}, that.infoCallback) - } else { - var token = wx.getStorageSync('userToken') - if (token) { - app.globalData.token = token - profile.getCustomerInfo({}, that.infoCallback) - } - } + app.getUserInfo(function(userInfo){ that.setData({userInfo: userInfo}) + + if (app.globalData.token) { + profile.getCustomerInfo({}, that.infoCallback) + } else { + var token = wx.getStorageSync('userToken') + if (token) { + app.globalData.token = token + profile.getCustomerInfo({}, that.infoCallback) + } + } }) },