ASR/miniprogram/vendor/wafer2-client-sdk/lib/session.js
Saturneric 73fc37e472 Add.
2020-09-01 00:55:41 +08:00

18 lines
402 B
JavaScript

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;