import Cookies from 'js-cookie'
import {Session,Local} from './storage'
const TokenKey = getKeyWordKey()// 获取token关键字
export function getKeyWordKey() {
  const origin = window.location.origin;
  return origin.indexOf("online.") >= 0
    ? "dy_admin_token"
    : "dy_admin_token_test";
}

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

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

}

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