|
|
|
@ -21,7 +21,7 @@ public class UserCenter { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private RedisUtil redisUtil; |
|
|
|
|
private final int EXPIRE = 3600 * 24 * 180; // 登录过期时间为180天
|
|
|
|
|
private final int EXPIRE = 3600 * 24 * 90; // 登录过期时间为90天
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存登录信息 |
|
|
|
@ -31,6 +31,17 @@ public class UserCenter { |
|
|
|
|
redisUtil.set(seObj.getToken(), seObj, EXPIRE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 刷新登录缓存时间 |
|
|
|
|
* @throws Exception |
|
|
|
|
*/ |
|
|
|
|
public void refresh(HttpServletRequest request) { |
|
|
|
|
String token = request.getHeader("Authorization"); |
|
|
|
|
if(StringUtils.isNotBlank(token)) { |
|
|
|
|
redisUtil.expire(token, EXPIRE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否登录 |
|
|
|
|
* @param request |
|
|
|
|