/**
 * @description: 用户权限获取
 * @author: Adrian
 */
import Cookies from 'js-cookie'
import utils from './utils'

const TokenKey = 'X-AUTH-TOKEN'

export function getToken() {
  const token = utils.getUrlKey('token')
  if (token) {
    setToken(token)
  }
  return Cookies.get(TokenKey)
}

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

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