fix 修复脱敏实现逻辑问题

2.X
疯狂的狮子li 3 years ago
parent ea8bdd4a9e
commit e42b2963e3

@ -27,9 +27,9 @@ public class SensitiveJsonSerializer extends JsonSerializer<String> implements C
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException { public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
SensitiveService sensitiveService = SpringUtils.getBean(SensitiveService.class); SensitiveService sensitiveService = SpringUtils.getBean(SensitiveService.class);
if (sensitiveService.isSensitive()) { if (sensitiveService.isSensitive()) {
gen.writeString(value);
} else {
gen.writeString(strategy.desensitizer().apply(value)); gen.writeString(strategy.desensitizer().apply(value));
} else {
gen.writeString(value);
} }
} }

@ -19,7 +19,7 @@ public class SysSensitiveServiceImpl implements SensitiveService {
*/ */
@Override @Override
public boolean isSensitive() { public boolean isSensitive() {
return LoginHelper.isAdmin(); return !LoginHelper.isAdmin();
} }
} }

Loading…
Cancel
Save