Commit 28fe7ec7 authored by 严俊's avatar 严俊

验证token调整

parent 8121bb24
package com.afanticar.afantiopenapi.config; package com.afanticar.afantiopenapi.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
...@@ -14,12 +15,17 @@ import javax.annotation.Resource; ...@@ -14,12 +15,17 @@ import javax.annotation.Resource;
@Configuration @Configuration
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
@Resource // @Resource
TokenInterceptor tokenInterceptor; // TokenInterceptor tokenInterceptor;
@Bean
public TokenInterceptor getLoginInterceptor(){
return new TokenInterceptor();
}
@Override @Override
public void addInterceptors(InterceptorRegistry register) { 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