feat: 继承类问题修改
This commit is contained in:
parent
8f39d5d12a
commit
bf870cc9aa
|
|
@ -38,12 +38,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.valueOf(field.get(data));
|
||||
if (StringUtils.isNotBlank(fieldValue)) {
|
||||
String encryptValue = AESEncryptUtil.encrypt(fieldValue);
|
||||
declaredField.set(data, encryptValue);
|
||||
field.set(data, encryptValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue