springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java
@@ -5,7 +5,6 @@ import com.panzhihua.common.model.helper.encrypt.EncryptQuery; import com.panzhihua.common.model.helper.encrypt.EncryptQueryClass; import com.panzhihua.common.model.helper.encrypt.IEncryptDecrypt; import com.panzhihua.common.model.helper.sensitive.Sensitive; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.binding.BindingException; import org.apache.ibatis.binding.MapperMethod; @@ -19,7 +18,6 @@ import java.lang.reflect.Field; import java.sql.PreparedStatement; import java.util.*; import java.util.stream.Stream; /** * 加密拦截器 @@ -40,7 +38,6 @@ @Override public Object intercept(Invocation invocation) throws Throwable { //拦截 ParameterHandler 的 setParameters 方法 动态设置参数 if (invocation.getTarget() instanceof ParameterHandler) { ParameterHandler parameterHandler = (ParameterHandler) invocation.getTarget(); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ResultInterceptor.java
@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import java.sql.Statement; @@ -27,6 +28,7 @@ @ConditionalOnProperty(value = "domain.decrypt", havingValue = "true") @Component @Slf4j @Order(110) public class ResultInterceptor implements Interceptor { @Autowired @@ -34,7 +36,6 @@ @Override public Object intercept(Invocation invocation) throws Throwable { log.info("解密拦截器"); Object result = invocation.proceed(); if (Objects.isNull(result)){ return null; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/sensitive/SensitiveInterceptor.java
@@ -11,6 +11,7 @@ import org.apache.ibatis.reflection.MetaObject; import org.apache.ibatis.reflection.SystemMetaObject; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import java.lang.reflect.Field; @@ -29,11 +30,12 @@ @Slf4j @ConditionalOnProperty(value = "domain.sensitive", havingValue = "true") @Component @Order(120) public class SensitiveInterceptor implements Interceptor { @SuppressWarnings("unchecked") @Override public Object intercept(Invocation invocation) throws Throwable { log.info("脱敏拦截器"); //log.debug("脱敏拦截器"); List<Object> records = (List<Object>) invocation.proceed(); // 对结果集脱敏 records.forEach(this::sensitive); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/bootstrap.yml
@@ -26,5 +26,5 @@ decrypt: true encrypt: true aesKey: Ryo7M3n8loC5 sensitive: false sensitive: true