import Cookies from 'js-cookie'

export const TokenKey = 'vue_admin_template_token'

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

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

export function setCodeToken (token) {
  return Cookies.set('codeToken', token)
}

export function getCodeToken () {
  return Cookies.get('codeToken')
}

export function removeToken (name = TokenKey) {
  return Cookies.remove(name)
}

export function setUserId (id) {
  return sessionStorage.setItem("User_Id", id)
}

export function getUserId () {
  return sessionStorage.getItem("User_Id")
}
