fix: 修复存储管理私有密钥校验错误

fix #76
This commit is contained in:
2024-06-24 21:11:50 +08:00
parent 9995bf0200
commit eb65cff4c7
2 changed files with 1 additions and 1 deletions

View File

@@ -76,7 +76,6 @@ public class StorageReq extends BaseReq {
* 私有密钥 * 私有密钥
*/ */
@Schema(description = "私有密钥", example = "") @Schema(description = "私有密钥", example = "")
@Length(max = 255, message = "私有密钥长度不能超过 {max} 个字符")
private String secretKey; private String secretKey;
/** /**

View File

@@ -189,6 +189,7 @@ public class StorageServiceImpl extends BaseServiceImpl<StorageMapper, StorageDO
// 新增时或修改了 SecretKey // 新增时或修改了 SecretKey
String secretKey = ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(newSecretKey)); String secretKey = ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(newSecretKey));
ValidationUtils.throwIfNull(secretKey, "私有密钥解密失败"); ValidationUtils.throwIfNull(secretKey, "私有密钥解密失败");
ValidationUtils.throwIf(secretKey.length() > 255, "私有密钥长度不能超过 255 个字符");
req.setSecretKey(secretKey); req.setSecretKey(secretKey);
} }