import { history } from '@umijs/max';

import { LOGIN_PATH } from '@/constants/global';

let _token = '';

export const setToken = (token: string) => {
  _token = token;
};

export const getToken = () => {
  return _token;
};

export const clearToken = () => {
  return (_token = '');
};

export const gotoLogin = () => {
  console.trace('gotoLogin');
  history.push(LOGIN_PATH);
};
