问题描述:
cn.hutool.core.bean.BeanException: Set value of [lastLoginTime] error!
问题分析:
1、在使用BeanUtil.copyProperties()方法时,lastLoginTime的类型不一致,导致报错。
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserVO{
private String username;
private LocalDate lastLoginTime;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserDto {
private String username;
private LocalDateTime lastLoginTime;
}
解决办法:使lastLoginTime的类型一致即可