|
|
@ -105,9 +105,10 @@ Page({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
check: function(cb) { |
|
|
|
check: function(cb) { |
|
|
|
var that = this; |
|
|
|
var that = this; |
|
|
|
if (app.globalData.userInfo) { |
|
|
|
if (wx.getStorageSync("userInfo")) { |
|
|
|
wx.setStorageSync("userInfo", app.globalData.userInfo); |
|
|
|
// wx.setStorageSync("userInfo", app.globalData.userInfo);
|
|
|
|
typeof cb == "function" && cb(app.globalData.userInfo); |
|
|
|
// typeof cb == "function" && cb(app.globalData.userInfo);
|
|
|
|
|
|
|
|
typeof cb == "function" && cb(wx.getStorageSync("userInfo")); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
wx.getSetting({ |
|
|
|
wx.getSetting({ |
|
|
|
success: function(res) { |
|
|
|
success: function(res) { |
|
|
@ -183,7 +184,7 @@ Page({ |
|
|
|
app.globalData.userInfo = response.data.userInfo; |
|
|
|
app.globalData.userInfo = response.data.userInfo; |
|
|
|
wx.setStorageSync("userInfo", response.data.userInfo); |
|
|
|
wx.setStorageSync("userInfo", response.data.userInfo); |
|
|
|
wx.setStorageSync('token', response.data.userInfo.token); |
|
|
|
wx.setStorageSync('token', response.data.userInfo.token); |
|
|
|
typeof cb == "function" && cb(app.globalData.userInfo); |
|
|
|
typeof cb == "function" && cb(wx.getStorageSync("userInfo")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -192,7 +193,7 @@ Page({ |
|
|
|
//显示登录或授权提示
|
|
|
|
//显示登录或授权提示
|
|
|
|
showLoginModal: function(cb) {
|
|
|
|
showLoginModal: function(cb) {
|
|
|
|
var that = this; |
|
|
|
var that = this; |
|
|
|
if (!app.globalData.userInfo) { |
|
|
|
if (!wx.getStorageSync("userInfo")) { |
|
|
|
//获取用户信息
|
|
|
|
//获取用户信息
|
|
|
|
wx.getSetting({ |
|
|
|
wx.getSetting({ |
|
|
|
success: function(sres) { |
|
|
|
success: function(sres) { |
|
|
@ -241,7 +242,7 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
typeof cb == "function" && cb(app.globalData.userInfo); |
|
|
|
typeof cb == "function" && cb(wx.getStorageSync("userInfo")); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
globalData: { |
|
|
|
globalData: { |
|
|
|