import { getCookie, setCookie, delCookie } from './cookie';

/**
 * 设置token
 * */
export const setToken = (value, time) => localStorage.setItem('antd-pro-token-onestop', value);

/**
 * 获取token
 * */
export const getToken = () => {
  const x = localStorage.getItem('antd-pro-token-onestop');
  if (x && x.length > 11) {
    return x;
  }
  const y = localStorage.getItem('antd-pro-token');
  if (y && y.length > 11) {
    return y;
  }

  return null;
};

/**
 * 删除token
 * */
export const delToken = () => localStorage.removeItem('antd-pro-token-onestop');
