import Cookies from 'js-cookie'
import {Session,Local} from './storage'
const TokenKey = 'loginToken'

export function getToken() {
  return Local.get('token') ||  Session.get('token')
}

export function setToken(token) {
  Session.set('token',token)
  Local.set('token',token)
  return Cookies.set(TokenKey, token)

}

export function removeToken() {
  Session.set('token','')
  Local.set('token','')
  return Cookies.remove(TokenKey)
}
