export returns { boolean } export function checkLogin ( ) { if ( ! window . localStorage . getItem ( 'TOKEN' ) || ! JSON . parse ( window . localStorage . getItem ( 'TOKEN' ) || '' ) . lifeTime ) { return false ; } const lifeTime = JSON . parse ( window . localStorage . getItem ( 'TOKEN' ) || '' ) . lifeTime * 1000 ; const nowTime = new Date ( ) . getTime ( ) ; if ( nowTime > lifeTime ) return false ; return true ; }