| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
| | | import org.springframework.cloud.gateway.filter.GlobalFilter; |
| | | import org.springframework.core.Ordered; |
| | |
| | | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | @Value("${token.secret}") |
| | | private String secret; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | String token = getToken(request); |
| | | Claims claims = JwtUtils.parseToken(token); |
| | | Claims claims = JwtUtils.parseToken(token, secret); |
| | | String userkey = JwtUtils.getUserKey(claims); |
| | | String userid = JwtUtils.getUserId(claims); |
| | | String username = JwtUtils.getUserName(claims); |
| | |
| | | if (StringUtils.isEmpty(token)) { |
| | | throw new NotLoginException("令牌不能为空"); |
| | | } |
| | | Claims claims = JwtUtils.parseToken(token); |
| | | Claims claims = JwtUtils.parseToken(token, secret); |
| | | if (claims == null) { |
| | | throw new NotLoginException("令牌已过期或验证不正确!"); |
| | | } |