import Cookies from 'js-cookie'

const TokenKey = 'TOKEN'

export function getToken(TokenKey) {
  return Cookies.get(TokenKey)
}

export function clearAllCookies() {
  var keys = Object.keys(Cookies.get())
  keys.forEach(item => Cookies.remove(item))
}
export function getCustomerName(customerName) {
  return Cookies.get(customerName)
}

export function setToken(name,token) {
  return Cookies.set(name, token)
}

export function removeToken(TokenKey) {
  localStorage.removeItem('menuList');
  return Cookies.remove(TokenKey)
}
