我原来的接口返回是第二张图的效果,修改后是第一张图的效果,单看返回的话只是以为是字体的问题,而且第一个在添加如下http配置之前还是乱码:
http:
encoding:
force: true
charset: utf-8
enabled: true
修改后的代码直接返回一个对象,未做任何处理。分析原来的代码返回值不是直接返回对象,而是这样
ResponseEntity.ok().header("Connection","keep-alive").body(data)
这里的ResponseEntity标识整个http相应,是org.springframework.http下的一个类