From 56c8c3fbdf13d275a2f7e5e8175d8d47c133addd Mon Sep 17 00:00:00 2001 From: bjang03 Date: Wed, 15 May 2024 15:32:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E6=97=B6=E4=BB=8Eredis=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=A8=A1=E5=9D=97=E6=9C=9F=E9=99=90=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/web/core/filter/ModuleAuthenInterceptor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/win-framework/win-spring-boot-starter-web/src/main/java/com/win/framework/web/core/filter/ModuleAuthenInterceptor.java b/win-framework/win-spring-boot-starter-web/src/main/java/com/win/framework/web/core/filter/ModuleAuthenInterceptor.java index 98a5b52..ab9b902 100644 --- a/win-framework/win-spring-boot-starter-web/src/main/java/com/win/framework/web/core/filter/ModuleAuthenInterceptor.java +++ b/win-framework/win-spring-boot-starter-web/src/main/java/com/win/framework/web/core/filter/ModuleAuthenInterceptor.java @@ -18,13 +18,14 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - String endTimeStr = ModuleAuthenUtils.module.getStr(md5.digestHex(request.getRequestURI().split("/")[1]),null); + String moduleName = request.getRequestURI().split("/")[1]; + String endTimeStr = ModuleAuthenUtils.module.getStr(md5.digestHex(moduleName),null); if(endTimeStr == null || "".equals(endTimeStr)){ - throw new Exception("没有当前模块使用权限,请联系服务商缴费开通"); + throw new Exception(String.format("没有【%s】模块使用权限,请联系服务商缴费开通",moduleName)); } LocalDateTime endTime = LocalDateTime.parse(ModuleAuthenUtils.decrypt(endTimeStr,ModuleAuthenUtils.secretKey), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); if (endTime == null || endTime.isBefore(LocalDateTime.now())){ - throw new Exception("权限到期或没有当前模块使用权限,请联系服务商缴费"); + throw new Exception(String.format("【%s】模块权限到期,请联系服务商缴费", moduleName)); } return true; }