Commit 9e9bb8cd authored by zhoumaotao's avatar zhoumaotao

config调整

parent c30b95e5
package com.gavel.kwell.config;
import java.util.Arrays;
import com.gavel.framework.filter.RequestWrapperFilter;
import com.gavel.framework.filter.ThreadContextFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.CharacterEncodingFilter;
import com.gavel.framework.filter.AuthenticationFilter;
import com.gavel.framework.filter.RequestWrapperFilter;
import com.gavel.framework.filter.ThreadContextFilter;
import java.util.Arrays;
@Configuration
public class FilterConfig {
......@@ -22,21 +22,21 @@ public class FilterConfig {
return filter;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Bean
public FilterRegistrationBean authenticationFilter() {
// 用户认证
AuthenticationFilter authenticationFilter = new AuthenticationFilter();
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setName("authenticationFilter"); // 过滤器名称
registrationBean.setFilter(authenticationFilter); // 注入过滤器
registrationBean.setOrder(10);
registrationBean.addInitParameter("prefix", "/css,/js,/images,/lib,/fonts,/mock");
registrationBean.setUrlPatterns(Arrays.asList("/*")); //拦截规则
return registrationBean;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
// @Bean
// public FilterRegistrationBean authenticationFilter() {
// // 用户认证
// AuthenticationFilter authenticationFilter = new AuthenticationFilter();
// FilterRegistrationBean registrationBean = new FilterRegistrationBean();
// registrationBean.setName("authenticationFilter"); // 过滤器名称
// registrationBean.setFilter(authenticationFilter); // 注入过滤器
// registrationBean.setOrder(10);
// registrationBean.addInitParameter("prefix", "/css,/js,/images,/lib,/fonts,/mock");
// registrationBean.setUrlPatterns(Arrays.asList("/*")); //拦截规则
// return registrationBean;
// }
@Bean
public FilterRegistrationBean requestWrapperFilter() {
RequestWrapperFilter requestWrapperFilter = new RequestWrapperFilter();
......
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