fix 修复 加解密拦截器null问题
This commit is contained in:
parent
a28dd0fe40
commit
84871d4cfb
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.common.encrypt.interceptor;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.encrypt.annotation.EncryptField;
|
||||
import com.ruoyi.common.encrypt.core.EncryptContext;
|
||||
@ -55,6 +56,9 @@ public class MybatisDecryptInterceptor implements Interceptor {
|
||||
* @param sourceObject 待加密对象
|
||||
*/
|
||||
private void decryptHandler(Object sourceObject) {
|
||||
if (ObjectUtil.isNull(sourceObject)) {
|
||||
return;
|
||||
}
|
||||
if (sourceObject instanceof Map<?, ?> map) {
|
||||
map.values().forEach(this::decryptHandler);
|
||||
return;
|
||||
|
@ -65,6 +65,9 @@ public class MybatisEncryptInterceptor implements Interceptor {
|
||||
* @param sourceObject 待加密对象
|
||||
*/
|
||||
private void encryptHandler(Object sourceObject) {
|
||||
if (ObjectUtil.isNull(sourceObject)) {
|
||||
return;
|
||||
}
|
||||
if (sourceObject instanceof Map<?, ?> map) {
|
||||
map.values().forEach(this::encryptHandler);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user