diff --git a/README.md b/README.md
index ddc71c62..91444926 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
-
+
@@ -216,7 +216,7 @@ public class DeptController extends BaseControllerArco Design | 2.56.0 | 字节跳动推出的前端 UI 框架,年轻化的色彩和组件设计。 |
| TypeScript | 5.0.4 | TypeScript 是微软开发的一个开源的编程语言,通过在 JavaScript 的基础上添加静态类型定义构建而成。 |
| Vite | 5.1.5 | 下一代的前端工具链,为开发提供极速响应。 |
-| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.7.3 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
+| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.7.4 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
| Spring Boot | 3.2.10 | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) |
| Undertow | 2.3.13.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 |
| Sa-Token + JWT | 1.39.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |
diff --git a/continew-common/src/main/java/top/continew/admin/common/util/SecureUtils.java b/continew-common/src/main/java/top/continew/admin/common/util/SecureUtils.java
index 28f0b5db..3c7baa00 100644
--- a/continew-common/src/main/java/top/continew/admin/common/util/SecureUtils.java
+++ b/continew-common/src/main/java/top/continew/admin/common/util/SecureUtils.java
@@ -22,7 +22,7 @@ import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.extra.spring.SpringUtil;
import top.continew.admin.common.config.properties.RsaProperties;
import top.continew.starter.core.exception.BusinessException;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.security.crypto.autoconfigure.CryptoProperties;
import top.continew.starter.security.crypto.encryptor.AesEncryptor;
import top.continew.starter.security.crypto.encryptor.IEncryptor;
diff --git a/continew-module-system/src/main/java/top/continew/admin/auth/service/impl/LoginServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/auth/service/impl/LoginServiceImpl.java
index 8438acb5..5c94aa72 100644
--- a/continew-module-system/src/main/java/top/continew/admin/auth/service/impl/LoginServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/auth/service/impl/LoginServiceImpl.java
@@ -60,7 +60,7 @@ import top.continew.admin.system.model.resp.MenuResp;
import top.continew.admin.system.service.*;
import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.autoconfigure.project.ProjectProperties;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.annotation.TreeField;
import top.continew.starter.extension.crud.autoconfigure.CrudProperties;
import top.continew.starter.messaging.websocket.util.WebSocketUtils;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/enums/PasswordPolicyEnum.java b/continew-module-system/src/main/java/top/continew/admin/system/enums/PasswordPolicyEnum.java
index ebfbb50f..0ca4be9f 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/enums/PasswordPolicyEnum.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/enums/PasswordPolicyEnum.java
@@ -29,7 +29,7 @@ import top.continew.admin.common.constant.SysConstants;
import top.continew.admin.system.model.entity.UserDO;
import top.continew.admin.system.service.OptionService;
import top.continew.admin.system.service.UserPasswordHistoryService;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import java.util.Map;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java
index 5d387549..9cf36146 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java
@@ -31,7 +31,7 @@ import top.continew.admin.system.model.resp.DeptResp;
import top.continew.admin.system.service.DeptService;
import top.continew.admin.system.service.RoleDeptService;
import top.continew.admin.system.service.UserService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.data.core.enums.DatabaseType;
import top.continew.starter.data.core.util.MetaUtils;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictItemServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictItemServiceImpl.java
index d7662aeb..9352c377 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictItemServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictItemServiceImpl.java
@@ -33,7 +33,7 @@ import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.enums.BaseEnum;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictServiceImpl.java
index 36302463..2e0dbdb0 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/DictServiceImpl.java
@@ -25,7 +25,7 @@ import top.continew.admin.system.model.req.DictReq;
import top.continew.admin.system.model.resp.DictResp;
import top.continew.admin.system.service.DictItemService;
import top.continew.admin.system.service.DictService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/FileServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/FileServiceImpl.java
index e80c4a8b..aceda06f 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/FileServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/FileServiceImpl.java
@@ -43,7 +43,7 @@ import top.continew.admin.system.service.StorageService;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.util.StrUtils;
import top.continew.starter.core.util.URLUtils;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
import java.time.LocalDate;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/LogServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/LogServiceImpl.java
index 219814b7..a333038e 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/LogServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/LogServiceImpl.java
@@ -38,7 +38,7 @@ import top.continew.admin.system.model.resp.log.LogResp;
import top.continew.admin.system.model.resp.log.LoginLogExportResp;
import top.continew.admin.system.model.resp.log.OperationLogExportResp;
import top.continew.admin.system.service.LogService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.query.SortQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MenuServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MenuServiceImpl.java
index 8b997b62..80669af3 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MenuServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MenuServiceImpl.java
@@ -33,7 +33,7 @@ import top.continew.admin.system.model.resp.MenuResp;
import top.continew.admin.system.service.MenuService;
import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.constant.StringConstants;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
import java.util.List;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageServiceImpl.java
index 0251346e..0c7ab677 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageServiceImpl.java
@@ -32,7 +32,7 @@ import top.continew.admin.system.model.req.MessageReq;
import top.continew.admin.system.model.resp.MessageResp;
import top.continew.admin.system.service.MessageService;
import top.continew.admin.system.service.MessageUserService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.data.mp.util.QueryWrapperHelper;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageUserServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageUserServiceImpl.java
index 9b32e046..134baa21 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageUserServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageUserServiceImpl.java
@@ -25,7 +25,7 @@ import top.continew.admin.system.model.entity.MessageUserDO;
import top.continew.admin.system.model.resp.MessageTypeUnreadResp;
import top.continew.admin.system.model.resp.MessageUnreadResp;
import top.continew.admin.system.service.MessageUserService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/OptionServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/OptionServiceImpl.java
index 95530b76..3ac3c472 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/OptionServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/OptionServiceImpl.java
@@ -37,8 +37,8 @@ import top.continew.admin.system.model.resp.OptionResp;
import top.continew.admin.system.service.OptionService;
import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.constant.StringConstants;
-import top.continew.starter.core.util.validate.CheckUtils;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.CheckUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.data.mp.util.QueryWrapperHelper;
import java.util.List;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java
index b0e361ff..a94628c1 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java
@@ -41,7 +41,7 @@ import top.continew.admin.system.model.resp.MenuResp;
import top.continew.admin.system.model.resp.RoleDetailResp;
import top.continew.admin.system.model.resp.RoleResp;
import top.continew.admin.system.service.*;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
import java.util.*;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java
index 11ed03ba..8c3a6b8f 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java
@@ -41,8 +41,8 @@ import top.continew.admin.system.util.ValidateGroup;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.util.ExceptionUtils;
import top.continew.starter.core.util.URLUtils;
-import top.continew.starter.core.util.validate.CheckUtils;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.CheckUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
import top.continew.starter.web.util.SpringWebUtils;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java
index 1b9f6a28..9f43513f 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java
@@ -27,7 +27,7 @@ import top.continew.admin.common.constant.SysConstants;
import top.continew.admin.system.mapper.UserRoleMapper;
import top.continew.admin.system.model.entity.UserRoleDO;
import top.continew.admin.system.service.UserRoleService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import java.util.List;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java
index c1b14ec5..67973641 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java
@@ -77,7 +77,7 @@ import top.continew.admin.system.service.*;
import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.exception.BusinessException;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.query.SortQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
diff --git a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserSocialServiceImpl.java b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserSocialServiceImpl.java
index 0b909d80..2b4e3ce9 100644
--- a/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserSocialServiceImpl.java
+++ b/continew-module-system/src/main/java/top/continew/admin/system/service/impl/UserSocialServiceImpl.java
@@ -31,7 +31,7 @@ import top.continew.admin.system.enums.SocialSourceEnum;
import top.continew.admin.system.mapper.UserSocialMapper;
import top.continew.admin.system.model.entity.UserSocialDO;
import top.continew.admin.system.service.UserSocialService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import me.zhyd.oauth.model.AuthUser;
diff --git a/continew-plugin/continew-plugin-generator/src/main/java/top/continew/admin/generator/service/impl/GeneratorServiceImpl.java b/continew-plugin/continew-plugin-generator/src/main/java/top/continew/admin/generator/service/impl/GeneratorServiceImpl.java
index c3b09e03..58686ad3 100644
--- a/continew-plugin/continew-plugin-generator/src/main/java/top/continew/admin/generator/service/impl/GeneratorServiceImpl.java
+++ b/continew-plugin/continew-plugin-generator/src/main/java/top/continew/admin/generator/service/impl/GeneratorServiceImpl.java
@@ -49,7 +49,7 @@ import top.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.exception.BusinessException;
import top.continew.starter.core.util.TemplateUtils;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.data.core.enums.DatabaseType;
import top.continew.starter.data.core.util.MetaUtils;
import top.continew.starter.extension.crud.model.query.PageQuery;
diff --git a/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java b/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java
index 4cd7d112..be5c8982 100644
--- a/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java
+++ b/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java
@@ -31,6 +31,7 @@ import top.continew.admin.open.model.resp.AppResp;
import top.continew.admin.open.model.resp.AppSecretResp;
import top.continew.admin.open.service.AppService;
import top.continew.starter.core.constant.StringConstants;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
import java.util.Optional;
@@ -50,7 +51,7 @@ public class AppServiceImpl extends BaseServiceImpl paramsMap) {
- // 根据应用密钥获取对应的应用密码
- String appKey = (String)((Map)paramsMap).get("appkey");
- String secretKey = this.appService.getSecretKeyByAccessKey(appKey);
- SaSignException.notEmpty(secretKey, "参与参数签名的秘钥不可为空", SaErrorCode.CODE_12201);
+ // 根据 AK 获取 SK
+ String accessKeyValue = (String)((Map)paramsMap).get(ACCESS_KEY);
+ String secretKey = appService.getSecretKeyByAccessKey(accessKeyValue);
+ ValidationUtils.throwIfBlank(secretKey, "密钥缺失, 请检查应用配置");
// 如果调用者不小心传入了 sign 参数,则此处需要将 sign 参数排除在外
if (paramsMap.containsKey(sign)) {
@@ -84,15 +76,8 @@ public class OpenSignTemplate extends SaSignTemplate {
}
// 计算签名
- String paramsStr = joinParamsDictSort(paramsMap);
+ String paramsStr = super.joinParamsDictSort(paramsMap);
String fullStr = paramsStr + "&" + key + "=" + secretKey;
- String signStr = abstractStr(fullStr);
-
- // 输入日志,方便调试
- log.debug("fullStr:{}", fullStr);
- log.debug("signStr:{}", signStr);
-
- // 返回
- return signStr;
+ return super.abstractStr(fullStr);
}
}
diff --git a/continew-webapi/src/main/java/top/continew/admin/config/satoken/SaTokenConfiguration.java b/continew-webapi/src/main/java/top/continew/admin/config/satoken/SaTokenConfiguration.java
index 2695e109..a4136667 100644
--- a/continew-webapi/src/main/java/top/continew/admin/config/satoken/SaTokenConfiguration.java
+++ b/continew-webapi/src/main/java/top/continew/admin/config/satoken/SaTokenConfiguration.java
@@ -21,6 +21,7 @@ import cn.dev33.satoken.context.SaHolder;
import cn.dev33.satoken.context.model.SaRequest;
import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.router.SaRouter;
+import cn.dev33.satoken.sign.SaSignTemplate;
import cn.dev33.satoken.sign.SaSignUtil;
import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
@@ -29,10 +30,11 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.continew.admin.common.context.UserContext;
import top.continew.admin.common.context.UserContextHolder;
-import top.continew.admin.open.sign.OpenSignTemplate;
+import top.continew.admin.open.sign.OpenApiSignTemplate;
import top.continew.starter.auth.satoken.autoconfigure.SaTokenExtensionProperties;
import top.continew.starter.core.constant.StringConstants;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.exception.BusinessException;
+import top.continew.starter.core.validation.CheckUtils;
import java.util.List;
@@ -40,6 +42,7 @@ import java.util.List;
* Sa-Token 配置
*
* @author Charles7c
+ * @author chengzi
* @since 2022/12/19 22:13
*/
@Configuration
@@ -48,7 +51,7 @@ public class SaTokenConfiguration {
private final SaTokenExtensionProperties properties;
private final LoginPasswordProperties loginPasswordProperties;
- private final OpenSignTemplate openSignTemplate;
+ private final OpenApiSignTemplate signTemplate;
/**
* Sa-Token 权限认证配置
@@ -63,31 +66,28 @@ public class SaTokenConfiguration {
*/
@Bean
public SaInterceptor saInterceptor() {
- SaManager.setSaSignTemplate(openSignTemplate);
+ SaManager.setSaSignTemplate(signTemplate);
return new SaExtensionInterceptor(handle -> SaRouter.match(StringConstants.PATH_PATTERN)
.notMatch(properties.getSecurity().getExcludes())
.check(r -> {
- // 拦截验证sign
- // 判断是否包含sign参数
+ // 如果包含 sign,进行 API 接口参数签名验证
SaRequest saRequest = SaHolder.getRequest();
List paramNames = saRequest.getParamNames();
- boolean matchParamSign = paramNames.stream().anyMatch(paramName -> paramName.equals("sign"));
- // 如果包含sign参数走SaToken API接口参数签名验证
- if (matchParamSign) {
+ if (paramNames.stream().anyMatch(SaSignTemplate.sign::equals)) {
try {
SaSignUtil.checkRequest(saRequest);
} catch (Exception e) {
- CheckUtils.throwIf(true, e.getMessage());
+ throw new BusinessException(e.getMessage());
}
- } else {
- // 如果不包含sign参数走登录token验证
- StpUtil.checkLogin();
- if (SaRouter.isMatchCurrURI(loginPasswordProperties.getExcludes())) {
- return;
- }
- UserContext userContext = UserContextHolder.getContext();
- CheckUtils.throwIf(userContext.isPasswordExpired(), "密码已过期,请修改密码");
+ return;
}
+ // 不包含 sign 参数,进行普通登录验证
+ StpUtil.checkLogin();
+ if (SaRouter.isMatchCurrURI(loginPasswordProperties.getExcludes())) {
+ return;
+ }
+ UserContext userContext = UserContextHolder.getContext();
+ CheckUtils.throwIf(userContext.isPasswordExpired(), "密码已过期,请修改密码");
}));
}
}
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/auth/AuthController.java b/continew-webapi/src/main/java/top/continew/admin/controller/auth/AuthController.java
index af54542b..b53cb830 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/auth/AuthController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/auth/AuthController.java
@@ -42,7 +42,7 @@ import top.continew.admin.system.model.resp.user.UserDetailResp;
import top.continew.admin.system.service.UserService;
import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.util.ExceptionUtils;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.log.core.annotation.Log;
import java.util.List;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/auth/SocialAuthController.java b/continew-webapi/src/main/java/top/continew/admin/controller/auth/SocialAuthController.java
index 100868ab..b63a0b01 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/auth/SocialAuthController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/auth/SocialAuthController.java
@@ -34,7 +34,7 @@ import top.continew.admin.auth.model.resp.LoginResp;
import top.continew.admin.auth.model.resp.SocialAuthAuthorizeResp;
import top.continew.admin.auth.service.LoginService;
import top.continew.starter.core.exception.BadRequestException;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.log.core.annotation.Log;
/**
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/common/CaptchaController.java b/continew-webapi/src/main/java/top/continew/admin/controller/common/CaptchaController.java
index 13b4098d..394695e4 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/common/CaptchaController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/common/CaptchaController.java
@@ -54,8 +54,8 @@ import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.captcha.graphic.core.GraphicCaptchaService;
import top.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.continew.starter.core.util.TemplateUtils;
-import top.continew.starter.core.util.validate.CheckUtils;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.CheckUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.log.core.annotation.Log;
import top.continew.starter.messaging.mail.util.MailUtils;
import top.continew.starter.security.limiter.annotation.RateLimiter;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/common/CommonController.java b/continew-webapi/src/main/java/top/continew/admin/controller/common/CommonController.java
index e29900e1..7f02aeae 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/common/CommonController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/common/CommonController.java
@@ -35,7 +35,7 @@ import top.continew.admin.system.enums.OptionCategoryEnum;
import top.continew.admin.system.model.query.*;
import top.continew.admin.system.model.resp.FileUploadResp;
import top.continew.admin.system.service.*;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.extension.crud.model.query.SortQuery;
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
import top.continew.starter.log.core.annotation.Log;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/common/DashboardController.java b/continew-webapi/src/main/java/top/continew/admin/controller/common/DashboardController.java
index 9da1c6e9..ef87fac9 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/common/DashboardController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/common/DashboardController.java
@@ -36,7 +36,7 @@ import top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp;
import top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp;
import top.continew.admin.system.model.resp.dashboard.DashboardOverviewCommonResp;
import top.continew.admin.system.service.DashboardService;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.log.core.annotation.Log;
import java.io.IOException;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/monitor/OnlineUserController.java b/continew-webapi/src/main/java/top/continew/admin/controller/monitor/OnlineUserController.java
index b428899b..d3de85eb 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/monitor/OnlineUserController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/monitor/OnlineUserController.java
@@ -32,7 +32,7 @@ import cn.dev33.satoken.stp.StpUtil;
import top.continew.admin.auth.model.query.OnlineUserQuery;
import top.continew.admin.auth.model.resp.OnlineUserResp;
import top.continew.admin.auth.service.OnlineUserService;
-import top.continew.starter.core.util.validate.CheckUtils;
+import top.continew.starter.core.validation.CheckUtils;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/system/MenuController.java b/continew-webapi/src/main/java/top/continew/admin/controller/system/MenuController.java
index b04c61ed..8c4dd783 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/system/MenuController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/system/MenuController.java
@@ -29,7 +29,7 @@ import top.continew.admin.system.model.resp.MenuResp;
import top.continew.admin.system.service.MenuService;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.util.URLUtils;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
import top.continew.starter.extension.crud.controller.BaseController;
import top.continew.starter.extension.crud.enums.Api;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/system/NoticeController.java b/continew-webapi/src/main/java/top/continew/admin/controller/system/NoticeController.java
index 8d37bb51..419b6550 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/system/NoticeController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/system/NoticeController.java
@@ -27,7 +27,7 @@ import top.continew.admin.system.model.req.NoticeReq;
import top.continew.admin.system.model.resp.NoticeDetailResp;
import top.continew.admin.system.model.resp.NoticeResp;
import top.continew.admin.system.service.NoticeService;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
import top.continew.starter.extension.crud.controller.BaseController;
import top.continew.starter.extension.crud.enums.Api;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/system/UserCenterController.java b/continew-webapi/src/main/java/top/continew/admin/controller/system/UserCenterController.java
index 13d1ecf1..dd77b05d 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/system/UserCenterController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/system/UserCenterController.java
@@ -45,7 +45,7 @@ import top.continew.admin.system.service.UserService;
import top.continew.admin.system.service.UserSocialService;
import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.util.ExceptionUtils;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import java.io.IOException;
import java.util.List;
diff --git a/continew-webapi/src/main/java/top/continew/admin/controller/system/UserController.java b/continew-webapi/src/main/java/top/continew/admin/controller/system/UserController.java
index c2c908be..ac82fc39 100644
--- a/continew-webapi/src/main/java/top/continew/admin/controller/system/UserController.java
+++ b/continew-webapi/src/main/java/top/continew/admin/controller/system/UserController.java
@@ -42,7 +42,7 @@ import top.continew.admin.system.model.resp.user.UserImportResp;
import top.continew.admin.system.model.resp.user.UserResp;
import top.continew.admin.system.service.UserService;
import top.continew.starter.core.util.ExceptionUtils;
-import top.continew.starter.core.util.validate.ValidationUtils;
+import top.continew.starter.core.validation.ValidationUtils;
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
import top.continew.starter.extension.crud.controller.BaseController;
import top.continew.starter.extension.crud.enums.Api;
diff --git a/continew-webapi/src/main/resources/banner.txt b/continew-webapi/src/main/resources/banner.txt
index 9cb46d53..5377f289 100644
--- a/continew-webapi/src/main/resources/banner.txt
+++ b/continew-webapi/src/main/resources/banner.txt
@@ -5,5 +5,5 @@
\____|\___/ |_| |_| \__||_||_| \_| \___| \_/\_/ /_/ \_\\__,_||_| |_| |_||_||_| |_|
:: ${project.name} :: v${project.version}
- :: ContiNew Starter :: v2.7.3
+ :: ContiNew Starter :: v2.7.4
:: Spring Boot :: v${spring-boot.version}
diff --git a/pom.xml b/pom.xml
index a50a89db..fdb2445b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
top.continew
continew-starter
- 2.7.3
+ 2.7.4
top.continew