无法登出的bug: 让 登录在获取wx user info之后执行,得到最新的code

wechat_user_type
Ge Hao 8 years ago
parent 347e4b64f6
commit e63103fbf3
  1. 20
      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)
}
}
})
},

Loading…
Cancel
Save