1生成4位随机码,添加后缀.
private static String random4Num() { int random = (int) ((Math.random() * 9 + 1) * 1000); return String.valueOf(random); }
2生成6位随机验证码
private static String random6Num() { int random = (int) ((Math.random() * 9 + 1) * 100000); return String.valueOf(random); }
时间: 2024-10-10 04:36:47