import Cookies from 'src/utils/sessionStore'

const TokenKey = 'Admin-Token'

const ExpiresInKey = 'Admin-Expires-In'

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

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

// 移除token
export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 过期时间
export function getExpiresIn() {
  return Cookies.get(ExpiresInKey) || -1
}

// 设置过期时间
export function setExpiresIn(time) {
  return Cookies.set(ExpiresInKey, time)
}

// 移除过期时间
export function removeExpiresIn() {
  return Cookies.remove(ExpiresInKey)
}
