From c554c7ad5405bafa149dbb6429e8245f78b33ffc Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 23 Dec 2020 15:59:53 +0800
Subject: [PATCH] modify

---
 zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 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..c48dfe0 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;
@@ -36,6 +37,9 @@
 	@Autowired
 	private WbeCommonInterceptor wbeCommonInterceptor;
 
+	@Autowired
+	private ApiUserLoginInterceptor apiUserLoginInterceptor;
+
 
 	/**
 	 * 添加拦截器
@@ -46,15 +50,29 @@
 	 */
 	@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/**");
+		registry.addInterceptor(userLoginInterceptor)
+				.addPathPatterns("/**")
+				.excludePathPatterns("/common/**")
+				.excludePathPatterns("/resource/**")
+				.excludePathPatterns("/swagger**/**")
+				.excludePathPatterns("/webjars/**")
+				.excludePathPatterns("/api/**");
+
 		// url权限拦截
 		registry.addInterceptor(suAuthorityInterceptor).addPathPatterns("/**/su/**");
 		//小程序公司与域名对应关系拦截

--
Gitblit v1.9.1