From a3ba78d7bd6448e1afa6f3fe47bea6262cfe8cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Wed, 25 May 2022 10:37:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E8=84=B1=E6=95=8F?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/jackson/SensitiveJsonSerializer.java | 4 ++-- .../ruoyi/system/service/impl/SysSensitiveServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/jackson/SensitiveJsonSerializer.java b/ruoyi-common/src/main/java/com/ruoyi/common/jackson/SensitiveJsonSerializer.java index 55c4e6a7..404f393f 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/jackson/SensitiveJsonSerializer.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/jackson/SensitiveJsonSerializer.java @@ -27,9 +27,9 @@ public class SensitiveJsonSerializer extends JsonSerializer implements C public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException { SensitiveService sensitiveService = SpringUtils.getBean(SensitiveService.class); if (sensitiveService.isSensitive()) { - gen.writeString(value); - } else { gen.writeString(strategy.desensitizer().apply(value)); + } else { + gen.writeString(value); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSensitiveServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSensitiveServiceImpl.java index 08d4cc4f..fe142ca3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSensitiveServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSensitiveServiceImpl.java @@ -20,7 +20,7 @@ public class SysSensitiveServiceImpl implements SensitiveService { */ @Override public boolean isSensitive() { - return LoginHelper.isAdmin(); + return !LoginHelper.isAdmin(); } }