用户身份证号码存数据库不脱敏
This commit is contained in:
@@ -96,7 +96,9 @@ public class UserController extends BaseController {
|
|||||||
public ApiResult<?> saveBatch(@RequestBody List<User> userList) {
|
public ApiResult<?> saveBatch(@RequestBody List<User> userList) {
|
||||||
userList.forEach(d -> {
|
userList.forEach(d -> {
|
||||||
d.setStatus(0);
|
d.setStatus(0);
|
||||||
|
if (d.getPassword() != null) {
|
||||||
d.setPassword(userService.encodePassword(d.getPassword()));
|
d.setPassword(userService.encodePassword(d.getPassword()));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (userService.saveBatch(userList)) {
|
if (userService.saveBatch(userList)) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
|
|||||||
@@ -73,9 +73,12 @@ public class User implements UserDetails {
|
|||||||
@ApiModelProperty("真实姓名")
|
@ApiModelProperty("真实姓名")
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
@ApiModelProperty("身份证号")
|
@ApiModelProperty("身份证号(脱敏)")
|
||||||
private String idCard;
|
private String idCard;
|
||||||
|
|
||||||
|
@ApiModelProperty("身份证号")
|
||||||
|
private String idCardNo;
|
||||||
|
|
||||||
@ApiModelProperty("出生日期")
|
@ApiModelProperty("出生日期")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date birthday;
|
private Date birthday;
|
||||||
@@ -299,7 +302,7 @@ public class User implements UserDetails {
|
|||||||
return DesensitizedUtil.mobilePhone(this.phone);
|
return DesensitizedUtil.mobilePhone(this.phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIdCard(){
|
public String getIdCardNo(){
|
||||||
return DesensitizedUtil.idCardNum(this.idCard,4,4);
|
return DesensitizedUtil.idCardNum(this.idCard,4,4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user