fastjson 序列化排除指定字段
在使用fastjson序列化时,没有使用的注解的情况下过滤不想要的字段
SimplePropertyPreFilter simplePropertyPreFilter = new SimplePropertyPreFilter();
simplePropertyPreFilter.getExcludes().add("password");
JSONObject userInfo = JSON.parseObject(JSON.toJSONBytes(principal, simplePropertyPreFilter));
System.out.println("userInfo = " + userInfo);
浙公网安备 33010602011771号