//设置cookie
function setStorage(key, value) {
  localStorage.setItem(key, JSON.stringify(value ? value : value === false ? value : ''))
}
//获取cookie
function getStorage(key) {
  var val = localStorage.getItem(key)
  if (val) {
    return JSON.parse(val)
  } else {
    return ''
  }
}
//删除cookie
function delStorage(key) {
  localStorage.removeItem(key)
}

export { setStorage, getStorage, delStorage }
