流程图 public class PhoneCode { //1.生成六位验证码 public static String getCode(){ Random random=new Random(); String code=""; for(int i=0;i<6;i++){ int rand=random.nextInt(10); code=code+rand; } return code; } //2.每个手机每天只能发送三次 public static void three(String phoneNum){ //连接redis Jedis jedis=new Jedis("192.168.70.128", 6379); //以手机号作为key,获取value作为发送次数 String sendCount=jedis.get(phoneNum); if(sendCount==null){ jedis.set(phoneNum, "1"); }else if(Integer.valueOf(sendCount)<3){ jedis.incr(phoneNum); }else{ System.out.println("发送次数超