随机数
//进入发送逻辑的时候生成随机验证码,六位数字
sale = RandomStringUtils.randomNumeric(6);
随机数范围
import java.util.Random; public class RandomUtil { public static Integer getInt(int min,int max){ Random random = new Random(); int res = random.nextInt(max) % (max - min + 1) + min; return res; } public static void randomSleep(int min,int max){ try{ Thread.sleep(getInt(min,max)); }catch (Exception e){} } }