|
|
|
@ -6,6 +6,7 @@ import java.time.LocalTime; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Random; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import javax.validation.Validator; |
|
|
|
|
|
|
|
|
@ -585,7 +586,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
} |
|
|
|
|
String verifyCode = String.valueOf((new Random()).nextInt(899999) + 100000); |
|
|
|
|
System.out.println("验证码:"+verifyCode); |
|
|
|
|
String message="【创巨圆】验证码:"+verifyCode+",此验证码只用于注册验证,15分钟内有效。如非本人操作,请忽略。"; |
|
|
|
|
String message="【创巨圆】验证码:"+verifyCode+",此验证码只用于注册验证,5分钟内有效。如非本人操作,请忽略。"; |
|
|
|
|
String cacheValue = redisCache.getCacheObject(phoneNumber+"_number"); |
|
|
|
|
if(cacheValue != null && Integer.parseInt(cacheValue) > 29){ |
|
|
|
|
return -2; |
|
|
|
@ -596,7 +597,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
LocalDateTime tomorrow = now.plusDays(1).with(LocalTime.MIN); |
|
|
|
|
Duration duration = Duration.between(now, tomorrow); |
|
|
|
|
long secondsUntilTomorrowMidnight = duration.getSeconds(); |
|
|
|
|
redisCache.setCacheObject(phoneNumber,verifyCode); |
|
|
|
|
redisCache.setCacheObject(phoneNumber,verifyCode,300, TimeUnit.SECONDS); |
|
|
|
|
Integer count= Integer.parseInt(redisCache.getCacheObject(phoneNumber+"_number")==null?"0":redisCache.getCacheObject(phoneNumber+"_number")); |
|
|
|
|
redisCache.setCacheObject(phoneNumber+"_number",String.valueOf(count+1)); |
|
|
|
|
redisCache.expire(phoneNumber+"_number",(int)secondsUntilTomorrowMidnight); |
|
|
|
@ -622,7 +623,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
return -3; |
|
|
|
|
} |
|
|
|
|
String verifyCode = String.valueOf((new Random()).nextInt(899999) + 100000); |
|
|
|
|
String message="【创巨圆】验证码:"+verifyCode+",此验证码只用于找回密码,15分钟内有效。如非本人操作,请忽略。"; |
|
|
|
|
String message="【创巨圆】验证码:"+verifyCode+",此验证码只用于找回密码,5分钟内有效。如非本人操作,请忽略。"; |
|
|
|
|
String cacheValue = redisCache.getCacheObject(phoneNumber+"_number"); |
|
|
|
|
System.out.println("验证码:"+verifyCode); |
|
|
|
|
if(cacheValue != null && Integer.parseInt(cacheValue) > 29){ |
|
|
|
@ -634,7 +635,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
LocalDateTime tomorrow = now.plusDays(1).with(LocalTime.MIN); |
|
|
|
|
Duration duration = Duration.between(now, tomorrow); |
|
|
|
|
long secondsUntilTomorrowMidnight = duration.getSeconds(); |
|
|
|
|
redisCache.setCacheObject(phoneNumber+"_forgetThePassword",verifyCode); |
|
|
|
|
redisCache.setCacheObject(phoneNumber+"_forgetThePassword",verifyCode,300, TimeUnit.SECONDS); |
|
|
|
|
Integer count= Integer.parseInt(redisCache.getCacheObject(phoneNumber+"_forgetThePassword"+"_number")==null?"0":redisCache.getCacheObject(phoneNumber+"_forgetThePassword"+"_number")); |
|
|
|
|
redisCache.setCacheObject(phoneNumber+"_forgetThePassword"+"_number",String.valueOf(count+1)); |
|
|
|
|
redisCache.expire(phoneNumber+"_forgetThePassword"+"_number",(int)secondsUntilTomorrowMidnight); |
|
|
|
|