You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
402 B
18 lines
402 B
var constants = require('./constants');
|
|
var SESSION_KEY = 'weapp_session_' + constants.WX_SESSION_MAGIC_ID;
|
|
|
|
var Session = {
|
|
get: function () {
|
|
return wx.getStorageSync(SESSION_KEY) || null;
|
|
},
|
|
|
|
set: function (session) {
|
|
wx.setStorageSync(SESSION_KEY, session);
|
|
},
|
|
|
|
clear: function () {
|
|
wx.removeStorageSync(SESSION_KEY);
|
|
},
|
|
};
|
|
|
|
module.exports = Session; |