/* 封装localstorage */
const namespace = 'GDY_';
const sessionSet = (key, val) => {
    const obj = JSON.stringify({"key": val});
    window.sessionStorage.setItem(namespace + key, obj);
}
const sessionGet = (key) => {
    let value = window.sessionStorage.getItem(namespace + key);
    value = JSON.parse(value) || {};
    return value.key;
}
const sessionRemove = (key) => {
    window.sessionStorage.removeItem(namespace + key);
}
const localSet = (key, val) => {
    const obj = JSON.stringify({"key": val});
    window.localStorage.setItem(namespace + key, obj);
}
const localGet = (key) => {
    let value = window.localStorage.getItem(namespace + key);
    value = JSON.parse(value) || {};
    return value.key;
}
const localRemove = (key) => {
    window.localStorage.removeItem(namespace + key);
}
export default {
    sessionSet,
    sessionGet,
    sessionRemove,
    localSet,
    localGet,
    localRemove,
}
