From 86dba4c9631c1c7d2f11a2fdd30427eeb5524105 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Wed, 27 May 2020 18:04:53 +0800 Subject: [PATCH] 20200527 代码提交 --- src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java b/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java index c31c084..ae63e6d 100644 --- a/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java +++ b/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java @@ -1,12 +1,16 @@ package com.xcong.excoin.configurations; +import com.xcong.excoin.configurations.security.UserAuthenticationArgumentResolver; import com.xcong.excoin.utils.SpringContextHolder; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringBootConfiguration; import org.springframework.context.annotation.Bean; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.List; /** * @author wzy @@ -17,7 +21,8 @@ public class WebMvcConfig implements WebMvcConfigurer { @Override - public void addInterceptors(InterceptorRegistry registry) { + public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) { + resolvers.add(new UserAuthenticationArgumentResolver()); } /** @@ -33,8 +38,8 @@ .allowCredentials(true).maxAge(3600); } - @Bean - public SpringContextHolder springContextHolder() { - return new SpringContextHolder(); - } +// @Bean +// public SpringContextHolder springContextHolder() { +// return new SpringContextHolder(); +// } } -- Gitblit v1.9.1