package com.ruoyi.framework.config;

import com.google.code.kaptcha.text.impl.DefaultTextCreator;

import java.security.SecureRandom;
import java.util.Random;

/**
 * 验证码文本生成器
 *
 * @author max
 */
public class KaptchaNumberCreator extends DefaultTextCreator {
    @Override
    public String getText() {
        Random random = new SecureRandom();
        double x = random.nextDouble();
        int i = (int) (x * 10000);
        return String.valueOf(i + (i < 1000 ? 1000 : 0));
    }

}
