提交 8e2bda07 authored 作者: 钟是志's avatar 钟是志

setToken方法修改

上级 14fe12b9
import { getCookie, setCookie, delCookie } from "./cookie";
import { getCookie, setCookie, delCookie } from './cookie';
/**
* 设置token
* */
export const setToken = (value, time) => localStorage.setItem("antd-pro-token-onestop", value);
export const setToken = (value, time) => localStorage.setItem('antd-pro-token-onestop', value);
/**
* 获取token
* */
export const getToken = () => {
const x = localStorage.getItem("antd-pro-token-onestop");
const x = localStorage.getItem('antd-pro-token-onestop');
if (x && x.length > 11) {
return x;
}
const y = localStorage.getItem("antd-pro-token");
const y = localStorage.getItem('antd-pro-token');
if (y && y.length > 11) {
return y;
}
......@@ -24,4 +24,4 @@ export const getToken = () => {
/**
* 删除token
* */
export const delToken = () => localStorage.removeItem("antd-pro-token-onestop");
export const delToken = () => localStorage.removeItem('antd-pro-token-onestop');
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论