lighty-admin-vite
Version:
基于 Vue3、TypeScript、Element Plus、Pinia 和 Vite 等主流技术.
15 lines (12 loc) • 330 B
text/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)
}