wupengfei
9 天以前 f37c78b6412db783615f8b38f0487c57136c4ed8
1
2
3
4
5
6
export function tokenIsExpired(userInfo: API.IdentityModelTokenCacheItem) {
  const now = new Date().getTime();
  const expiresIn = userInfo.expiresIn;
  const expired = (now - new Date(userInfo.creationTime).getTime()) / 1000 >= expiresIn - 300;
  return expired;
}