From 2562e13a8db342cc1e23e17b8a26d84ce314f9eb Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 13 Aug 2021 12:04:57 +0800
Subject: [PATCH] 20210813
---
zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java b/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java
index 989b5cc..54801c7 100644
--- a/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java
+++ b/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java
@@ -3,6 +3,7 @@
import com.matrix.core.interceptor.WbeCommonInterceptor;
+import com.matrix.system.common.interceptor.ApiUserLoginInterceptor;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.common.interceptor.SuAuthorityInterceptor;
import com.matrix.system.common.interceptor.UserLoginInterceptor;
@@ -19,7 +20,7 @@
* @description 容器添加组件
* @date 2019-06-14 15:50
*/
-@Configuration
+@Configuration()
@PropertySource("classpath:config/system.properties")
public class MvcCoreConfig implements WebMvcConfigurer {
@@ -36,6 +37,9 @@
@Autowired
private WbeCommonInterceptor wbeCommonInterceptor;
+ @Autowired
+ private ApiUserLoginInterceptor apiUserLoginInterceptor;
+
/**
* 添加拦截器
@@ -46,19 +50,30 @@
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
+ // 手机端拦截
+ registry.addInterceptor(apiUserLoginInterceptor)
+ .addPathPatterns("/api/**")
+ .excludePathPatterns("/api/common/**");
+
// 公共拦截
registry.addInterceptor(wbeCommonInterceptor)
.addPathPatterns("/**")
.excludePathPatterns("/css/**")
.excludePathPatterns("/js/**")
.excludePathPatterns("/images/**")
- .excludePathPatterns("/plugin/**");
+ .excludePathPatterns("/plugin/**")
+ .excludePathPatterns("/swagger**/**")
+ .excludePathPatterns("/webjars/**");
+
// 用户认证拦截
- registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/common/**").excludePathPatterns("/resource/**");
- // url权限拦截
- registry.addInterceptor(suAuthorityInterceptor).addPathPatterns("/**/su/**");
+ registry.addInterceptor(userLoginInterceptor)
+ .addPathPatterns("/admin/**");
+
+
//小程序公司与域名对应关系拦截
- registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**");
+ registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**")
+ .excludePathPatterns("/wxCommon/wxapi/wxpayCallback")
+ .excludePathPatterns("/wxCommon/wxapi/rechargeCallBack");
}
--
Gitblit v1.9.1