/** 统一处理 Token / CSRF Token 的存取 */

import { getCsrfToken, removeCsrfToken, setCsrfToken } from "@sud-web/utils"
import CacheKey from "@/constants/cacheKey"

export {
  getCsrfToken,
  setCsrfToken
}

export function getToken() {
  return localStorage.getItem(CacheKey.TOKEN)
}
export function setToken(token: string) {
  if (token) {
    return localStorage.setItem(CacheKey.TOKEN, token)
  }
}
export function removeToken() {
  removeCsrfToken()
}
