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

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

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

@ -24,9 +24,7 @@ Page({
onLoad: function() { onLoad: function() {
var that = this 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) profile.getCustomerInfo({}, that.infoCallback)
@ -37,7 +35,7 @@ Page({
profile.getCustomerInfo({}, that.infoCallback) profile.getCustomerInfo({}, that.infoCallback)
} }
} }
})
}, },
bindGetPassCode: function(e) { bindGetPassCode: function(e) {
@ -133,5 +131,4 @@ Page({
}) })
}) })
} }
}) })
Loading…
Cancel
Save