kongdeqiang
2023-04-26 cb5c9968b763362d399e1c7fce1129ec7434aba8
src/libs/storage.js
@@ -8,6 +8,14 @@
    }
    window.localStorage.setItem(name, content);
}
export const setSessionStore = (name, content) => {
    if (!name) return;
    if (typeof content !== 'string') {
        content = JSON.stringify(content);
    }
    window.sessionStorage.setItem(name, content);
}
/**
 * 获取localStorage
@@ -21,6 +29,16 @@
    return v;
}
export const getSessionStore = name => {
    if (!name) return;
    let v = window.sessionStorage.getItem(name);
    if (v == null) {
        return "";
    }
    return v;
}
/**
 * 删除localStorage
 */