修改如下:

1.去掉无用的抛出异常
This commit is contained in:
mayuanfei 2023-01-17 17:55:36 +08:00
parent 79d90d0d73
commit 8320608cb9
6 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ import com.ruoyi.common.encrypt.IEncryptor;
* @date 2023-01-17 16:52
*/
public abstract class AbstractEncryptor implements IEncryptor {
public AbstractEncryptor(EncryptContext context) throws Exception{
public AbstractEncryptor(EncryptContext context) {
//子类必须实现带参数的构造方法
}
}

View File

@ -21,7 +21,7 @@ public class AesEncryptor extends AbstractEncryptor {
private AES aes = null;
public AesEncryptor(EncryptContext context) throws Exception{
public AesEncryptor(EncryptContext context) {
super(context);
String password = context.getPassword();
if (StrUtil.isBlank(password)) {

View File

@ -13,7 +13,7 @@ import com.ruoyi.common.enums.EncodeType;
*/
public class Base64Encryptor extends AbstractEncryptor {
public Base64Encryptor(EncryptContext context) throws Exception {
public Base64Encryptor(EncryptContext context) {
super(context);
}

View File

@ -21,7 +21,7 @@ public class RsaEncryptor extends AbstractEncryptor {
private RSA rsa = null;
public RsaEncryptor(EncryptContext context) throws Exception {
public RsaEncryptor(EncryptContext context) {
super(context);
String privateKey = context.getPrivateKey();
String publicKey = context.getPublicKey();

View File

@ -21,7 +21,7 @@ public class Sm2Encryptor extends AbstractEncryptor {
private SM2 sm2 = null;
public Sm2Encryptor(EncryptContext context) throws Exception {
public Sm2Encryptor(EncryptContext context) {
super(context);
String privateKey = context.getPrivateKey();
String publicKey = context.getPublicKey();

View File

@ -20,7 +20,7 @@ public class Sm4Encryptor extends AbstractEncryptor {
private SM4 sm4 = null;
public Sm4Encryptor(EncryptContext context) throws Exception {
public Sm4Encryptor(EncryptContext context) {
super(context);
String password = context.getPassword();
if (StrUtil.isBlank(password)) {