k94314517
2024-04-28 3f0fb748ae4ecf0a28fbcffa8637b04f6d739a58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.doumee.config.cloudfilter;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
@Configuration
public class CloudWebConfig implements WebMvcConfigurer {
    @Autowired
    private RedisTemplate<String,Object> stringRedisTemplate;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginHandlerInterceptor(stringRedisTemplate))
                .addPathPatterns("/cloudService/**");
    }
}