!8 sync 同步ruoyi-vue-plus更新

fix -- 修复代码生成页面错误bug
fix -- 调整返回类型为R,修正脚本
This commit is contained in:
KonBAI
2022-01-30 15:34:26 +00:00
parent 47539482b4
commit a423f02fad
187 changed files with 2181 additions and 1821 deletions

View File

@@ -16,6 +16,7 @@ import java.util.Objects;
/**
* 数据脱敏json序列化工具
*
* @author Yjoioooo
*/
public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer {
@@ -25,7 +26,7 @@ public class SensitiveJsonSerializer extends JsonSerializer<String> implements C
@Override
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
SensitiveService sensitiveService = SpringUtils.getBean(SensitiveService.class);
if (sensitiveService.isSensitive()){
if (sensitiveService.isSensitive()) {
gen.writeString(value);
} else {
gen.writeString(strategy.desensitizer().apply(value));
@@ -36,7 +37,7 @@ public class SensitiveJsonSerializer extends JsonSerializer<String> implements C
@Override
public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property) throws JsonMappingException {
Sensitive annotation = property.getAnnotation(Sensitive.class);
if (Objects.nonNull(annotation)&&Objects.equals(String.class, property.getType().getRawClass())) {
if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass())) {
this.strategy = annotation.strategy();
return this;
}