package com.hfkj.common.security;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class VerifyCodeStorage {

	private static Logger log = LoggerFactory.getLogger(VerifyCodeStorage.class);

	private static final int EXPIRE = 600;//cookie过期时间为10分钟，600秒


    /**
     * @param
     * @throws Exception
     */
    public static void save(VerifyCode verifyCode) throws Exception{
        LoginCache.setData(verifyCode.getUniqueCode(), verifyCode, EXPIRE);
    }


    public static VerifyCode getDate(String uniqueCode) throws Exception{
        return LoginCache.getData(uniqueCode);
    }

    public static void remove(String uniqueCode) throws Exception{
        LoginCache.clear(uniqueCode);
    }
}
