token.js 501 Bytes
Newer Older
徐立's avatar
徐立 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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!=null&&(x=="null"||x=="undefined")){
        return null;
    }
    return x;
}

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