From 56b923f5db8bc3b72c64c4bf0730f48108e0fab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E8=B1=AA?= <980287353@qq.com> Date: Fri, 24 Feb 2023 18:42:42 +0800 Subject: [PATCH] publish 0.7.2 --- pom.xml | 20 +++++++++---------- springboot-ademo/pom.xml | 2 +- .../demo/controller/TestController.java | 4 +--- springboot-annotation/pom.xml | 2 +- springboot-database/pom.xml | 2 +- springboot-encrypt/pom.xml | 2 +- springboot-login/pom.xml | 2 +- .../login/config/token/TsTokenAspect.java | 11 ++++++++-- .../login/config/token/TsTokenConfig.java | 10 +++++++++- springboot-message/pom.xml | 2 +- springboot-platform/pom.xml | 2 +- springboot-poi/pom.xml | 2 +- springboot-util/pom.xml | 2 +- springboot-web/pom.xml | 2 +- 14 files changed, 39 insertions(+), 26 deletions(-) diff --git a/pom.xml b/pom.xml index bba0c53..ccaa759 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 pom springboot-parent 杭州铁晟科技有限公司基础依赖 @@ -57,55 +57,55 @@ com.tiesheng.springboot-parent springboot-database - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-login - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-web - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-util - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-platform - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-message - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-encrypt - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-annotation - 0.7.1 + 0.7.2 com.tiesheng.springboot-parent springboot-poi - 0.7.1 + 0.7.2 diff --git a/springboot-ademo/pom.xml b/springboot-ademo/pom.xml index 040c135..51a5b2b 100644 --- a/springboot-ademo/pom.xml +++ b/springboot-ademo/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-ademo diff --git a/springboot-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java b/springboot-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java index 041c8e0..7caecaf 100644 --- a/springboot-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java +++ b/springboot-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java @@ -48,15 +48,13 @@ public class TestController { } @RequestMapping("/redirect") - @TokenIgnore public void redirect(HttpServletResponse response) { - tsTokenConfig.validToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzYwMDY4NzUsImlkIjoiMSIsImVudmlyb25tZW50VHlwZSI6Im1vYmlsZSIsInNlcnZpY2UiOiJjb250ZXN0LXJlc2VydmUiLCJleHRyYSI6IiJ9.nsfxEFpCNHC7eNCS5DJXdu1VDdnHrTjSfgrozND70Lc", true); +// tsTokenConfig.validToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzYwMDY4NzUsImlkIjoiMSIsImVudmlyb25tZW50VHlwZSI6Im1vYmlsZSIsInNlcnZpY2UiOiJjb250ZXN0LXJlc2VydmUiLCJleHRyYSI6IiJ9.nsfxEFpCNHC7eNCS5DJXdu1VDdnHrTjSfgrozND70Lc", true); // globalConfig.redirect("mobile", "/test", response); } @RequestMapping("/send") - @TokenIgnore public ApiResp sendMessage() { MessageReqResp reqResp = aliyunSmsConfig.sendSms("13567116463", "SMS_154950909", JSONUtil.createObj().putOpt("code", "123456")); diff --git a/springboot-annotation/pom.xml b/springboot-annotation/pom.xml index 4d3565d..32ffd02 100644 --- a/springboot-annotation/pom.xml +++ b/springboot-annotation/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-annotation diff --git a/springboot-database/pom.xml b/springboot-database/pom.xml index c1f9e43..970d1f1 100644 --- a/springboot-database/pom.xml +++ b/springboot-database/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-database diff --git a/springboot-encrypt/pom.xml b/springboot-encrypt/pom.xml index fda2ec5..ec60736 100644 --- a/springboot-encrypt/pom.xml +++ b/springboot-encrypt/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-encrypt diff --git a/springboot-login/pom.xml b/springboot-login/pom.xml index 0a6a4ed..284a782 100644 --- a/springboot-login/pom.xml +++ b/springboot-login/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-login diff --git a/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenAspect.java b/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenAspect.java index 1d9a7a2..b1b6c1c 100644 --- a/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenAspect.java +++ b/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenAspect.java @@ -1,6 +1,8 @@ package com.tiesheng.login.config.token; +import cn.hutool.core.util.StrUtil; import com.tiesheng.annotation.token.TokenIgnore; +import com.tiesheng.util.ServletKit; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; @@ -46,13 +48,18 @@ public class TsTokenAspect { @Before("methodArgs()") public void before(JoinPoint joinPoint) { + // 过滤不要需要验证的接口(path) + String requestURI = ServletKit.getRequest().getRequestURI(); + if (StrUtil.startWithAnyIgnoreCase(requestURI, tsTokenConfig.getIgnorePaths())) { + return; + } + + // 过滤不要需要验证的接口(注解) Object aThis = joinPoint.getTarget(); TokenIgnore annotation = aThis.getClass().getAnnotation(TokenIgnore.class); if (annotation != null) { return; } - - // 过滤不要需要验证的接口 MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); TokenIgnore apiTokenIgnore = method.getAnnotation(TokenIgnore.class); diff --git a/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenConfig.java b/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenConfig.java index 5c7d89c..c9a5d51 100644 --- a/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenConfig.java +++ b/springboot-login/src/main/java/com/tiesheng/login/config/token/TsTokenConfig.java @@ -1,7 +1,6 @@ package com.tiesheng.login.config.token; -import cn.hutool.core.date.DateUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.servlet.ServletUtil; @@ -27,6 +26,7 @@ public class TsTokenConfig { private Map ignores = MapUtil.newHashMap(); private String encryptKey = "%kIp9frQCu"; private Integer expireHours = 48; + private String[] ignorePaths; /** @@ -139,4 +139,12 @@ public class TsTokenConfig { public void setExpireHours(Integer expireHours) { this.expireHours = expireHours; } + + public String[] getIgnorePaths() { + return ignorePaths; + } + + public void setIgnorePaths(String[] ignorePaths) { + this.ignorePaths = ignorePaths; + } } diff --git a/springboot-message/pom.xml b/springboot-message/pom.xml index d650857..6de4976 100644 --- a/springboot-message/pom.xml +++ b/springboot-message/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-message diff --git a/springboot-platform/pom.xml b/springboot-platform/pom.xml index 9ea544f..cf62ac1 100644 --- a/springboot-platform/pom.xml +++ b/springboot-platform/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-platform diff --git a/springboot-poi/pom.xml b/springboot-poi/pom.xml index 1ecdc93..e9fbdae 100644 --- a/springboot-poi/pom.xml +++ b/springboot-poi/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-poi diff --git a/springboot-util/pom.xml b/springboot-util/pom.xml index 61e53a4..538a47b 100644 --- a/springboot-util/pom.xml +++ b/springboot-util/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-util diff --git a/springboot-web/pom.xml b/springboot-web/pom.xml index 3b9df48..3892790 100644 --- a/springboot-web/pom.xml +++ b/springboot-web/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 0.7.1 + 0.7.2 springboot-web