CeDo
2021-04-06 9e3316b5fbc9396d118c9148f37adb93f4711746
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/sensitive/SensitiveInterceptor.java
@@ -33,7 +33,7 @@
    @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);
@@ -64,6 +64,7 @@
            // 获取对应的脱敏策略 并进行脱敏
            SensitiveStrategy type = annotation.strategy();
            Object o = type.getDesensitizer().apply((String) value);
            log.debug("脱敏信息:{}->{}" ,  value, o.toString() );
            // 把脱敏后的值塞回去
            metaObject.setValue(name, o);
        }