| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.time.Duration; |
| | | |
| | | /** |
| | | * 用户行为 侦听器的实现 |
| | |
| | | dto.setTokenId(tokenValue); |
| | | dto.setUserName(user.getUsername()); |
| | | dto.setDeptName(user.getDeptName()); |
| | | RedisUtils.setCacheObject(Constants.ONLINE_TOKEN_KEY + tokenValue, dto, tokenConfig.getTimeout(), TimeUnit.SECONDS); |
| | | RedisUtils.setCacheObject(Constants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(tokenConfig.getTimeout())); |
| | | log.info("user doLogin, userId:{}, token:{}", loginId, tokenValue); |
| | | } else if (userType == UserType.APP_USER) { |
| | | // app端 自行根据业务编写 |