This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
handingkang-ohmyweb/src/utils/cache/cookies.ts
2022-08-24 16:52:01 +08:00

15 lines
330 B
TypeScript

/** 统一处理 Cookie */
import CacheKey from "@/constants/cacheKey"
import Cookies from "js-cookie"
export const getToken = () => {
return Cookies.get(CacheKey.TOKEN)
}
export const setToken = (token: string) => {
Cookies.set(CacheKey.TOKEN, token)
}
export const removeToken = () => {
Cookies.remove(CacheKey.TOKEN)
}