|
|
@@ -17,14 +17,15 @@ import java.sql.SQLException;
|
|
|
@Component
|
|
|
public class AesEncryptTypeHandler <T> extends BaseTypeHandler<T> {
|
|
|
|
|
|
- @Value("${mybatis-plus.mrxu-encrypt.aesKey:EF8FF97BD3EE2217B0850ACCF3732DF5}")
|
|
|
- private String aesKey = "EF8FF97BD3EE2217B0850ACCF3732DF3";
|
|
|
+ @Value("${mybatis-plus.mrxu-encrypt.aesKey:}")
|
|
|
+ private String aesKey;
|
|
|
|
|
|
@Override
|
|
|
public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException {
|
|
|
MrxuAssert.isNotEmpty(aesKey,"请设置aes加密秘钥:mybatis-plus.mrxu-encrypt.aesKey");
|
|
|
ps.setString(i, SecureUtil.aes(aesKey.getBytes(StandardCharsets.UTF_8)).encryptBase64((String)parameter));
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public T getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
|
|
MrxuAssert.isNotEmpty(aesKey,"请设置aes加密秘钥:mybatis-plus.mrxu-encrypt.aesKey");
|