Commit a6ae0bd2 authored by Quxl's avatar Quxl

x

parent 69fb261c
...@@ -6,11 +6,11 @@ import org.springframework.context.annotation.Bean; ...@@ -6,11 +6,11 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.i18n.SessionLocaleResolver; import org.springframework.web.servlet.i18n.SessionLocaleResolver;
@Configuration @Configuration
public class I18Config extends WebMvcConfigurerAdapter { public class I18Config implements WebMvcConfigurer {
@Bean @Bean
public LocaleResolver localeResolver() { public LocaleResolver localeResolver() {
SessionLocaleResolver slr = new SessionLocaleResolver(); SessionLocaleResolver slr = new SessionLocaleResolver();
......
...@@ -8,8 +8,6 @@ import org.springframework.web.context.request.async.DeferredResult; ...@@ -8,8 +8,6 @@ import org.springframework.web.context.request.async.DeferredResult;
import com.egolm.common.DateUtil; import com.egolm.common.DateUtil;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo; import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
......
...@@ -3,19 +3,22 @@ package com.egolm.shop.config; ...@@ -3,19 +3,22 @@ package com.egolm.shop.config;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.egolm.shop.config.interceptor.OpenInterceptor; import com.egolm.shop.config.interceptor.OpenInterceptor;
@Configuration @Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter { public class WebMvcConfig implements WebMvcConfigurer {
@Autowired @Autowired
private OpenInterceptor openInterceptor; OpenInterceptor openInterceptor;
@Override
@Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
//注册自定义拦截器,添加拦截路径和排除拦截路径 //注册自定义拦截器,添加拦截路径和排除拦截路径
/*System.out.println("-addInterceptors------"); /*System.out.println("-addInterceptors------");
registry.addInterceptor(openInterceptor).excludePathPatterns("api/path/login"); registry.addInterceptor(openInterceptor).excludePathPatterns("api/path/login");
super.addInterceptors(registry); */ super.addInterceptors(registry); */
} }
} }
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