auth.js 514 Bytes
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const ShowDialog = 'show-dialog'

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

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

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

export function getDialog() {
  return Cookies.get(ShowDialog)
}

export function setDialog() {
  return Cookies.set(ShowDialog, true)
}

export function removeDialog() {
  return Cookies.remove(ShowDialog)
}