| | |
| | | package org.dromara.common.encrypt.interceptor; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | list.forEach(this::decryptHandler); |
| | | return; |
| | | } |
| | | // 不在缓存中的类,就是没有加密注解的类(当然也有可能是typeAliasesPackage写错) |
| | | Set<Field> fields = encryptorManager.getFieldCache(sourceObject.getClass()); |
| | | if(ObjectUtil.isNull(fields)){ |
| | | return; |
| | | } |
| | | try { |
| | | for (Field field : fields) { |
| | | field.set(sourceObject, this.decryptField(String.valueOf(field.get(sourceObject)), field)); |
| | | field.set(sourceObject, this.decryptField(Convert.toStr(field.get(sourceObject)), field)); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("处理解密字段时出错", e); |