From c4f383570112d6def81705fe9f7c6442514f56b4 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Fri, 17 May 2024 09:49:57 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=8B=A6=E6=88=AA=E5=99=A8=E6=88=AA=E5=8F=96=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=8E=E6=9C=AC=E5=9C=B0=E7=8E=AF=E5=A2=83=E6=9C=89=E5=B7=AE?= =?UTF-8?q?=E5=BC=82=EF=BC=8C=E5=A4=9A=E4=BA=86=E4=B8=80=E5=B1=82/api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/web/config/ModuleAuthenInterceptor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/win-module-system/win-module-system-biz/src/main/java/com/win/module/system/framework/web/config/ModuleAuthenInterceptor.java b/win-module-system/win-module-system-biz/src/main/java/com/win/module/system/framework/web/config/ModuleAuthenInterceptor.java index bf7bf30..e268a32 100644 --- a/win-module-system/win-module-system-biz/src/main/java/com/win/module/system/framework/web/config/ModuleAuthenInterceptor.java +++ b/win-module-system/win-module-system-biz/src/main/java/com/win/module/system/framework/web/config/ModuleAuthenInterceptor.java @@ -24,7 +24,7 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor { int count = 0; int index = -1; - while(count < 5) { + while(count < 2) { index = str.indexOf(c, index + 1); count++; } @@ -33,7 +33,10 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor { } @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - String moduleName = request.getRequestURI().substring(0,findThirdOccurrence(request.getRequestURI(),'/')); + String uri = request.getRequestURI().substring(request.getRequestURI().indexOf("admin-api")+"admin-api".length()); + String moduleName = uri.substring(0,findThirdOccurrence(request.getRequestURI(),'/')); + log.info(String.format("===uri-src=%s,uri-md5=%s===",moduleName,md5.digestHex(moduleName))); + log.info(String.format("===cache=%s===", new JSONObject(ModuleAuthenUtils.module).toString())); String endTimeStr = ModuleAuthenUtils.module.get(md5.digestHex(moduleName)); if(endTimeStr != null){ LocalDateTime endTime = LocalDateTime.parse(ModuleAuthenUtils.decrypt(endTimeStr,ModuleAuthenUtils.secretKey), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));