import Cookies from "js-cookie";

/**
 * @description 统一Token操作
 */
type CookiesKeyTypes = "Token" | "language";

export const getCookies = (key: CookiesKeyTypes) => {
    return Cookies.get(key);
};
/**
 * @description 设置cookies
 */
export const setCookies = (key: CookiesKeyTypes, value: string) => {
    Cookies.set(key, value);
};
/**
 * @description 删除
 */
export const removeCookies = (key: CookiesKeyTypes) => {
    Cookies.remove(key, { path: "" });
};
/**
 * @description 获取token
 */
export const getToken = () => {
    return getCookies("Token");
};
