Commit b44ac22e authored by hezhen's avatar hezhen

Merge branch 'hz_master' into base-modify

parents 78425aac 9370da80
......@@ -20,7 +20,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
public class RedisConfiguration {
@Bean
public RedisTemplate<String, Object> universalRedisTemplate(RedisConnectionFactory factory) {
public RedisTemplate<String, Object> customRedisTemplate(RedisConnectionFactory factory) {
RedisTemplate redisTemplate = new RedisTemplate();
redisTemplate.setConnectionFactory(factory);
RedisSerializer<String> stringSerializer = new StringRedisSerializer();
......
......@@ -3,6 +3,7 @@ package com.xxfc.platform.universal.config;
import com.github.wxiaoqi.security.auth.client.interceptor.ServiceAuthRestInterceptor;
import com.github.wxiaoqi.security.auth.client.interceptor.UserAuthRestInterceptor;
import com.github.wxiaoqi.security.common.handler.GlobalExceptionHandler;
import com.xxfc.platform.universal.interceptor.WeChatH5LoginInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
......@@ -29,6 +30,10 @@ public class WebConfiguration implements WebMvcConfigurer {
addPathPatterns(getIncludePathPatterns()).addPathPatterns("/3p/**");
registry.addInterceptor(getUserAuthRestInterceptor()).
addPathPatterns(getIncludePathPatterns());
registry.addInterceptor(getUserAuthRestInterceptor()).
addPathPatterns(getIncludePathPatterns());
registry.addInterceptor(getWeChatH5LoginInterceptor()
).addPathPatterns(getWxIncludePathPatterns());
}
@Bean
......@@ -41,6 +46,10 @@ public class WebConfiguration implements WebMvcConfigurer {
return new UserAuthRestInterceptor();
}
@Bean
WeChatH5LoginInterceptor getWeChatH5LoginInterceptor() { return new WeChatH5LoginInterceptor();
}
/**
* 需要用户和服务认证判断的路径
* @return
......@@ -53,6 +62,14 @@ public class WebConfiguration implements WebMvcConfigurer {
Collections.addAll(list, urls);
return list;
}
private ArrayList<String> getWxIncludePathPatterns() {
ArrayList<String> list = new ArrayList<>();
String[] urls = {
"/info/**"
};
Collections.addAll(list, urls);
return list;
}
/* @Bean(name = "customTaskExecutor")
TaskExecutor getTaskExecutor(){
......
package com.xxfc.platform.universal.interceptor;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.util.UserAgentUtil;
import com.xxfc.platform.universal.biz.WeixinService;
......@@ -11,7 +12,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;
......
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