| | |
| | | package com.doumee.config.cloudfilter; |
| | | |
| | | import com.doumee.config.jwt.JwtProperties; |
| | | import com.doumee.config.jwt.JwtTokenUtil; |
| | | import com.doumee.core.utils.Constants; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.Filter; |
| | | |
| | | @Configuration |
| | | public class CloudWebConfig implements WebMvcConfigurer { |
| | | @Autowired |
| | | private RedisTemplate<String,Object> stringRedisTemplate; |
| | | @Resource |
| | | private JwtProperties jwtProperties; |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(new LoginHandlerInterceptor(stringRedisTemplate)) |
| | | registry.addInterceptor(new LoginHandlerInterceptor(stringRedisTemplate, |
| | | jwtProperties==null || jwtProperties.getExpiration()==null?1800000l:jwtProperties.getExpiration())) |
| | | .addPathPatterns(Constants.CLOUD_SERVICE_URL_INDEX+"/**"); |
| | | } |
| | | |