import cookie from 'js-cookie'
export default {
  setObj(key, value) {
    localStorage.setItem(key, JSON.stringify(value))
  },
  getObj(key) {
    return JSON.parse(localStorage.getItem(key))
  },
  removeObj(key) {
    localStorage.removeItem(key)
  },
  getSession(key) {
    return JSON.parse(sessionStorage.getItem(key))
  },
  setSession(key, value) {
    sessionStorage.setItem(key, JSON.stringify(value))
  },
  setCookie(key, value) {
    cookie.set(key, value)
  },
  getCookie(key) {
    return cookie.get(key)
  },
  setStr(key, value) {
    localStorage.setItem(key, value)
  },
  getStr(key) {
    return localStorage.getItem(key)
  },
  getInt(key) {
    return parseInt(localStorage.getItem(key))
  },
}
