Commit 84edc424 authored by 严俊's avatar 严俊

Merge branch 'dev-activity-faw' of...

Merge branch 'dev-activity-faw' of http://gitlab.afanticar.com:13140/java-ms/afanti-open-api into develop
parents c5975f1d 83a4423d
......@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -31,15 +32,14 @@ import java.util.concurrent.TimeUnit;
* @since 2023/4/26/026
*/
@Slf4j
@Setter
@Component
public class TokenInterceptor implements HandlerInterceptor {
public class TokenInterceptor extends HandlerInterceptorAdapter {
@Autowired
private AfantiCasFeign casFeign;
@Autowired
RedissonClient redissonClient;
private RedissonClient redissonClient;
@Autowired
private IgnoredUri ignoredUri;
......
package com.afanticar.afantiopenapi.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
......@@ -14,12 +15,17 @@ import javax.annotation.Resource;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Resource
TokenInterceptor tokenInterceptor;
// @Resource
// TokenInterceptor tokenInterceptor;
@Bean
public TokenInterceptor getLoginInterceptor(){
return new TokenInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry register) {
register.addInterceptor(tokenInterceptor);
register.addInterceptor(getLoginInterceptor());
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment