|
@@ -30,6 +30,10 @@ function wxLogin(successcallback, failcallback) {
|
|
|
|
|
|
// 获取 openid 和 session_key
|
|
|
function getOpenidSessionKey(successcallback, failcallback) {
|
|
|
+ if (wx.getStorageSync('user')) {
|
|
|
+ successcallback(wx.getStorageSync('user'));
|
|
|
+ return;
|
|
|
+ }
|
|
|
wxLogin(function(res) {
|
|
|
//console.log('获取sessionKey等内容'+JSON.stringify(res.data));
|
|
|
let sessionKey = res.data.session_key;
|
|
@@ -62,6 +66,7 @@ function getLoginSchedule(sessionKey, successcallback, failcallback) {
|
|
|
duration: 1500
|
|
|
})
|
|
|
wx.setStorageSync('uid', res.data.data.uid)
|
|
|
+ wx.setStorageSync('user', res)
|
|
|
successcallback(res)
|
|
|
});
|
|
|
},
|