从后端返回前端不序列化
导包
使用Jackson包,使得查询得到的某些字段不被序列化,即传递不到前端
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.0</version>
</dependency>
注解
给实体类加上如下注解即可
@JsonIgnore
private String password;