// 封装操作sessionStorage

const storage = {
    get (key) {
        try {
            return JSON.parse(sessionStorage.getItem(key))
        } catch (err) {
            return sessionStorage.getItem(key)
        }
    },
    set (key, value) {
        sessionStorage.setItem(key, JSON.stringify(value))
    },
    remove (key) {
        sessionStorage.removeItem(key)
    },
}
export default storage   //  将 storage 暴露出去