CeDo
2021-04-06 4cded15f644b1a4e2d7391b083ea9be93140f026
bug fixed:脱敏失效修复
3个文件已修改
8 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ResultInterceptor.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/sensitive/SensitiveInterceptor.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ParammeterInterceptor.java
@@ -38,8 +38,6 @@
    @Override
    public Object intercept(Invocation invocation) throws Throwable {
        //log.debug("加密拦截器");
        //拦截 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.debug("解密拦截器");
        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,6 +30,7 @@
@Slf4j
@ConditionalOnProperty(value = "domain.sensitive", havingValue = "true")
@Component
@Order(120)
public class SensitiveInterceptor implements Interceptor {
    @SuppressWarnings("unchecked")
    @Override
@@ -64,7 +66,6 @@
            // 获取对应的脱敏策略 并进行脱敏
            SensitiveStrategy type = annotation.strategy();
            Object o = type.getDesensitizer().apply((String) value);
            log.debug("脱敏信息:{}->{}" ,  value, o.toString() );
            // 把脱敏后的值塞回去
            metaObject.setValue(name, o);
        }