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