feat: 继承类问题修改
This commit is contained in:
parent
bf870cc9aa
commit
c70964a8e2
|
|
@ -85,12 +85,11 @@ public class EncryptUtil {
|
|||
List<Map<String, String>> values = new ArrayList<>();
|
||||
for (T data : dataList) {
|
||||
for (Field field : fieldList) {
|
||||
Field declaredField = data.getClass().getDeclaredField(field.getName());
|
||||
declaredField.setAccessible(true);
|
||||
String fieldValue = (String) declaredField.get(data);
|
||||
field.setAccessible(true);
|
||||
String fieldValue = (String) field.get(data);
|
||||
if (StringUtils.isNotBlank(fieldValue)) {
|
||||
String encryptValue = AESEncryptUtil.encrypt(fieldValue);
|
||||
declaredField.set(data, encryptValue);
|
||||
field.set(data, encryptValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -115,12 +114,11 @@ public class EncryptUtil {
|
|||
List<Field> fieldList = getFields(clazz);
|
||||
if (CollectionUtils.isNotEmpty(fieldList)) {
|
||||
for (Field field : fieldList) {
|
||||
Field declaredField = data.getClass().getDeclaredField(field.getName());
|
||||
declaredField.setAccessible(true);
|
||||
String fieldValue = (String) declaredField.get(data);
|
||||
field.setAccessible(true);
|
||||
String fieldValue = (String) field.get(data);
|
||||
if (StringUtils.isNotBlank(fieldValue)) {
|
||||
String encryptValue = AESEncryptUtil.decrypt(fieldValue);
|
||||
declaredField.set(data, encryptValue);
|
||||
field.set(data, encryptValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -144,12 +142,11 @@ public class EncryptUtil {
|
|||
if (CollectionUtils.isNotEmpty(fieldList)) {
|
||||
for (T data : dataList) {
|
||||
for (Field field : fieldList) {
|
||||
Field declaredField = data.getClass().getDeclaredField(field.getName());
|
||||
declaredField.setAccessible(true);
|
||||
String fieldValue = (String) declaredField.get(data);
|
||||
field.setAccessible(true);
|
||||
String fieldValue = (String) field.get(data);
|
||||
if (StringUtils.isNotBlank(fieldValue)) {
|
||||
String encryptValue = AESEncryptUtil.decrypt(fieldValue);
|
||||
declaredField.set(data, encryptValue);
|
||||
field.set(data, encryptValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue