/** 统一处理 Cookie */

import CacheKey from "@/constants/cacheKey"
import Cookies from "js-cookie"

export const getToken = (): number | undefined => {
  const tokenString = Cookies.get(CacheKey.TOKEN)
  if (tokenString) {
    return Number.parseInt(tokenString)
  }
}
export const setToken = (token: number) => {
  Cookies.set(CacheKey.TOKEN, token.toString())
}
export const removeToken = () => {
  Cookies.remove(CacheKey.TOKEN)
}
