From f32268777e572504f04a845a39d7d425974c5d2f Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期三, 14 四月 2021 15:49:18 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java index b7e4f1f..8cb0c8a 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java @@ -75,16 +75,18 @@ Map.Entry<String, Object> entry = (Map.Entry<String, Object>) iterator.next(); if (entry.getKey().startsWith("param")) { Object v = entry.getValue(); - EncryptQueryClass encryptQueryClass = AnnotationUtils.findAnnotation(v.getClass(), EncryptQueryClass.class); - if (Objects.nonNull(encryptQueryClass)) { - Field[] declaredFields = v.getClass().getDeclaredFields(); - for (Field field : declaredFields) { - if (field.isAnnotationPresent(EncryptQuery.class)) { - try { - final Object encrypt = encryptDecrypt.encrypt(new Field[]{field}, v); - paramMap.put("encrypted", true); - } catch (IllegalAccessException e) { - e.printStackTrace(); + if(v!=null) { + EncryptQueryClass encryptQueryClass = AnnotationUtils.findAnnotation(v.getClass(), EncryptQueryClass.class); + if (Objects.nonNull(encryptQueryClass)) { + Field[] declaredFields = v.getClass().getDeclaredFields(); + for (Field field : declaredFields) { + if (field.isAnnotationPresent(EncryptQuery.class)) { + try { + final Object encrypt = encryptDecrypt.encrypt(new Field[]{field}, v); + paramMap.put("encrypted", true); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } } } } -- Gitblit v1.7.1