From e60938e6bf6edf5da6dd7f9f6cc831fdcf27a69f Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期二, 06 八月 2024 11:27:56 +0800 Subject: [PATCH] 松套管配置套管 --- framework/src/main/java/com/yuanchu/mom/config/FiferConfig.java | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/com/yuanchu/mom/config/FiferConfig.java b/framework/src/main/java/com/yuanchu/mom/config/FiferConfig.java index 3d0662c..bf55558 100644 --- a/framework/src/main/java/com/yuanchu/mom/config/FiferConfig.java +++ b/framework/src/main/java/com/yuanchu/mom/config/FiferConfig.java @@ -1,5 +1,6 @@ package com.yuanchu.mom.config; +import com.yuanchu.mom.annotation.ValueAuth; import com.yuanchu.mom.utils.JackSonUtil; import com.yuanchu.mom.utils.Jwt; import com.yuanchu.mom.utils.RedisUtil; @@ -8,6 +9,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; @@ -29,6 +31,15 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) { response.setStatus(HttpServletResponse.SC_OK); + return true; + } + try { + HandlerMethod h = (HandlerMethod)handler; + ValueAuth annotation = h.getMethodAnnotation(ValueAuth.class); + if(annotation!=null){ + return true; + } + }catch (Exception e){ return true; } String[] strs = request.getRequestURL().toString().split(serverPort); @@ -73,12 +84,11 @@ @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { - } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { -// System.out.println("-------------------------鎷︽埅鍣ㄦ牎楠岄�氳繃---------------------------"); + } private List<String> list; @@ -89,6 +99,7 @@ list.add("/user/enter"); list.add("/user/refresh"); + list.add("/outPath/**"); this.list = list; } -- Gitblit v1.9.3