String token = JWT.create().withHeader(header).withClaim("user", JSON.toJSONString(user)).withIssuedAt(iatDate)
// .withExpiresAt(expiresDate)
.sign(Algorithm.HMAC256(SECRET));
try {
StringRedisTemplate redis = ApplicationContextUtils.getBean(StringRedisTemplate.class);
redis.opsForValue().set(Const.REDIS_TOKEN_PREFIX + token, user.getLoginName(), 240L, TimeUnit.MINUTES);
} catch (Exception e) {
throw new BusinessErrorException(ErrorMsg.TOKEN_REDIS_ERROR);
}
return token;