对象如下

package com.songhu.server.business.auth.vo;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: yc
 * @date: 2019-05-10 09:23
 * @description
 */
@Data
@NoArgsConstructor
public class CaptchaVo implements Serializable {
    private static final long serialVersionUID = -4483557859018427223L;
    /**
     * 验证码号
     */
    private String captcha;
    /**
     * 有效次数
     */
    private int effectiveTimes = 3;
    /**
     * 发送给的 手机号码
     */
    private String tel;
    /**
     * 验证次数
     */
    private int retryCount;
    /**
     * 获取时间
     */
    private Date getTime;

    public CaptchaVo(String captcha, int effectiveTimes, String tel) {
        this.captcha = captcha;
        this.effectiveTimes = effectiveTimes;
        this.tel = tel;
        this.getTime = new Date();
    }
}


序列化进入redis之后

image.png

凭空多了一个effectiveTime字段。
怀疑是由于getEffectiveTime方法造成的,删除掉该方法之后,序列化的数据恢复正常。
具体原因还没找到。