Commit 3091ce21 authored by 赵啸非's avatar 赵啸非

添加session.js文件

parent 9a8ac265
/**
* 本地存储函数
*/
const session = {
// 设置
setSession(key, val) {
sessionStorage.setItem(key, JSON.stringify(val));
},
// 获取
getSession(key) {
return JSON.parse(sessionStorage.getItem(key));
},
// 删除本地存储
removeSession(key) {
sessionStorage.removeItem(key)
},
// 清空本地存储
clearSession() {
sessionStorage.clear();
},
};
// 暴露
export default session;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment