From e2fa151fa701b9107ab3a8eba0f2ae6c3879fe8d Mon Sep 17 00:00:00 2001 From: bjang03 Date: Mon, 20 May 2024 09:10:07 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8B=A6=E6=88=AA=E5=99=A8=E5=AF=BC=E8=87=B4=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=8A=A5=E9=94=99BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/web/config/ModuleAuthenInterceptor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 ca1fce6..fe3cac6 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 < 2) { + while(count < 3) { index = str.indexOf(c, index + 1); count++; } @@ -33,8 +33,9 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor { } @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - String uri = request.getRequestURI().substring(request.getRequestURI().indexOf("admin-api")+"admin-api".length()); - String moduleName = uri.substring(0,findThirdOccurrence(request.getRequestURI(),'/')); + String[] uris = request.getRequestURI().split("admin-api"); + String uri = uris[uris.length-1]; + String moduleName = uri.substring(0,findThirdOccurrence(uri,'/')); 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));