/*
 * @Author: jixiang
 * @Date: 2021-07-01 15:31:32
 * @Description: cookie
 * @FilePath: /suqian_pc_new/src/utils/cookie.ts
 * 56580223@qq.com
 */

import Cookies from 'js-cookie';

const TokenKey = 'fighter-auth-token';
const RefreshTokenKey = 'refresh-token';

export function getToken() {
  return Cookies.get(TokenKey);
}
export function getTokenKey() {
  return TokenKey;
}
export function getRefreshTokenKey() {
  return RefreshTokenKey;
}

export function setToken(token: any) {
  return Cookies.set(TokenKey, token);
}

export function getRefreshToken() {
  return Cookies.get(RefreshTokenKey);
}

export function setRefreshToken(refreshToken: any) {
  return Cookies.set(RefreshTokenKey, refreshToken);
}

export function removeToken() {
  Cookies.remove(TokenKey);
  Cookies.remove(RefreshTokenKey);
}
