diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 295530f..b895588 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -20,12 +20,11 @@ Page({ var that = this var token = wx.getStorageSync('userToken') if (token) { - that.setData({needBindMobile: false}) var data = {token: token} profile.getCustomerInfo(data, that.infoCallback) } app.getUserInfo(function(userInfo){ - that.setData({userInfo:userInfo}) + that.setData({userInfo: userInfo}) }) }, diff --git a/utils/profile.js b/utils/profile.js index 24826ed..ddcc1f4 100644 --- a/utils/profile.js +++ b/utils/profile.js @@ -17,6 +17,11 @@ function getCustomerInfo (data, cb) { header: { 'Content-Type': 'application/json'}, data: data, success: function(res) { + if (res.data.msg === 'Need Mobile') { + return + } + var pages = getCurrentPages() + pages[pages.length-1].setData({needBindMobile: false}) app.globalData.currentCustomer = res.data.customer app.globalData.token = res.data.token wx.setStorage({