| | |
| | | import io.jsonwebtoken.JwtException; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String,Object> redisTemplate; |
| | | |
| | | /** |
| | | * 是否开发者 |
| | | */ |
| | | @Value("${debug_model}") |
| | | private Boolean isDebug; |
| | | |
| | | /** |
| | | * 添加拦截器 |
| | |
| | | public Boolean checkPersonnelLogin(HttpServletRequest request, HttpServletResponse response){ |
| | | String token = request.getHeader(JwtTokenUtil.HEADER_KEY); |
| | | try { |
| | | if(isDebug){ |
| | | return true; |
| | | } |
| | | //判断Token是否超时 |
| | | boolean expiration = JwtTokenUtil.isTokenExpired(token); |
| | | if (expiration) { |