import jwt from "jsonwebtoken";
export const secure = 'abcd123xxxxxxxxxxxx'
// 解密获取用户信息
export const checkLogin = () => {
const token = getToken();
if (!token) return null;
return jwt.decode(token, secure);
}
export const getToken = () => {
return window.sessionStorage.getItem('token');
}
return window.sessionStorage.getItem('token');
结论:好用!
标签:解决办法,return,secure,window,token,export,失效,const
From: https://www.cnblogs.com/jycom/p/16948630.html