Commit 420a55ba by “zcwang”

add: 登录验证

parent 8a31c288
...@@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration; ...@@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
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.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/** /**
...@@ -14,7 +15,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter ...@@ -14,7 +15,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
* @date 2021/8/27 10:18 * @date 2021/8/27 10:18
*/ */
@Configuration @Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter { public class WebMvcConfig implements WebMvcConfigurer{
@Autowired @Autowired
private LoginInterceptor loginInterceptor; private LoginInterceptor loginInterceptor;
...@@ -26,38 +27,7 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter { ...@@ -26,38 +27,7 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
*/ */
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(loginInterceptor).addPathPatterns("/**") registry.addInterceptor(loginInterceptor).addPathPatterns("/**");
.excludePathPatterns("/i/health")
.excludePathPatterns("/getHeliosCacheConfig")
.excludePathPatterns("/getDistributedCacheSchedule")
.excludePathPatterns("/getLocalCacheSchedule")
.excludePathPatterns("/nameSpace")
.excludePathPatterns("/loadEnvClusterInfo")
.excludePathPatterns("/test/**")
.excludePathPatterns("/sdk/resultForCacheKey")
.excludePathPatterns("/sdk/reportDispatchResult")
.excludePathPatterns("/sdk/getOpMessage")
.excludePathPatterns("/sdk/opMessageResp")
.excludePathPatterns("/openapi/control/**")
.excludePathPatterns("/sacs/ape/callback");
super.addInterceptors(registry);
} }
@Bean
public ThreadPoolTaskExecutor mvcTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10);
executor.setQueueCapacity(100);
executor.setMaxPoolSize(25);
return executor;
}
//配置异步支持,设置了一个用来异步执行业务逻辑的工作线程池,设置了默认的超时时间是60秒
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setTaskExecutor(mvcTaskExecutor());
configurer.setDefaultTimeout(apolloConfig.getLongPollingTimeout());
}
} }
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