export default {
    storage:window.sessionStorage,
    setToken(token)
    {
        this.storage._token_ = token
    },
    getToken()
    {
        return this.storage._token_
    },
    setUser(userId)
    {
        return this.storage._nam_ = userId
    },
    getUser()
    {
        return this.storage._nam_
    },
    setMenu(menu)
    {
        let menuJsn = JSON.stringify(menu)
        this.storage.menu = menuJsn
    },
    getMenu()
    {
        let menuJsn = this.storage.menu
        if(menuJsn)
            return JSON.parse(menuJsn)
    },
    setItem(key,value)
    {
        this.storage.setItem(key,value)
    },
    getItem(key)
    {
        return this.storage.getItem(key)
    },
    setItems(objs)
    {
        for(let key in objs)
            this.setItem(key,objs[key])
    },
    getItems(objs)
    {
        let nobj = {} 
        for(let key in objs)
        {
           nobj[key] = this.getItem(key)
        }
        return objs
    },
    clearItems()
    {
        this.storage.clear()
    },
    remoteItem(key)
    {
        this.storage.remove(key)
    }
}