把微信的登录分离到打开应用时

wechat_user_type
Ge Hao 8 years ago
parent 188b11aa9d
commit 94e300feda
  1. 2
      app.js
  2. 23
      pages/mine/mine.js

@ -6,6 +6,8 @@ App({
this.store = new(jsonApi.JsonApiDataStore)
this.jsonModel = jsonApi.JsonApiDataStoreModel
this.globalData.code = wx.getStorageSync('code')
this.getUserInfo()
},
getUserInfo: function (cb) {

@ -24,20 +24,18 @@ Page({
onLoad: function() {
var that = this
that.setData({userInfo: app.globalData.userInfo})
app.getUserInfo(function(userInfo){
that.setData({userInfo: userInfo})
if (app.globalData.token) {
if (app.globalData.token) {
profile.getCustomerInfo({}, that.infoCallback)
} else {
var token = wx.getStorageSync('userToken')
if (token) {
app.globalData.token = token
profile.getCustomerInfo({}, that.infoCallback)
} else {
var token = wx.getStorageSync('userToken')
if (token) {
app.globalData.token = token
profile.getCustomerInfo({}, that.infoCallback)
}
}
})
}
},
bindGetPassCode: function(e) {
@ -133,5 +131,4 @@ Page({
})
})
}
})
})

Loading…
Cancel
Save