Gson替换掉多漏洞的FastJson
添加依赖:
<!-- gson --> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.5</version> </dependency>
测试:
DemoVo vo = new DemoVo(); System.out.println(new Gson().toJson(vo));