import Cookies from 'js-cookie'

const TokenKey = 'exhibition_page_token'
const UserInfoKey = 'exhibition_page_userInfo'

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

export function setToken(token) {
  return localStorage.setItem(TokenKey,token)
  // return Cookies.set(TokenKey, token)
}

export function removeToken() {
  // return Cookies.remove(TokenKey)
  localStorage.removeItem(TokenKey)
}

export function setUserInfo(userInfo){
  return localStorage.setItem(UserInfoKey,JSON.stringify(userInfo))
}

export function getUserInfo() {
  // return Cookies.get(TokenKey)
  return JSON.parse(localStorage.getItem(UserInfoKey))
}

export function removeUserInfo() {
  // return Cookies.remove(TokenKey)
  localStorage.removeItem(UserInfoKey)
}
