|
@@ -4,6 +4,7 @@ import com.diagbot.dto.ImgVerCreatDTO;
|
|
|
import com.diagbot.entity.ImgVerInfo;
|
|
|
import com.diagbot.entity.SwsVerInfo;
|
|
|
import com.diagbot.entity.User;
|
|
|
+import com.diagbot.enums.ConstantEnum;
|
|
|
import com.diagbot.enums.VisibleIdTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -29,7 +30,6 @@ import org.springframework.stereotype.Component;
|
|
|
@Component
|
|
|
public class VerFacade {
|
|
|
|
|
|
- public final static int SMS_MINS = 3000; //短信验证码间隔为3分钟 //TODO 时间间隔先调大了,之后改为3
|
|
|
@Autowired
|
|
|
private ImgVerService imgVerService;
|
|
|
@Autowired
|
|
@@ -104,7 +104,7 @@ public class VerFacade {
|
|
|
//验证是否超过三分钟
|
|
|
SwsVerInfo swsVerInfoCheck = smsVerService.getSmsVerification(smsVerCreatVO.getMobile());
|
|
|
if (null != swsVerInfoCheck) {
|
|
|
- if (DateUtil.after(DateUtil.addMinutes(swsVerInfoCheck.getCreateTime(), VerFacade.SMS_MINS),
|
|
|
+ if (DateUtil.after(DateUtil.addMinutes(swsVerInfoCheck.getCreateTime(), ConstantEnum.SMS_EXPIRED_INTERVAL.getKey()),
|
|
|
DateUtil.now())) {
|
|
|
throw new CommonException(ServiceErrorCode.SMS_SEND_ERROR,
|
|
|
"同一用户三分钟之内不能重复发送验证短信,请三分钟之后再次发送!");
|
|
@@ -158,7 +158,7 @@ public class VerFacade {
|
|
|
//验证是否超过三分钟
|
|
|
SwsVerInfo swsVerInfoCheck = smsVerService.getSmsVerification(smsVerCreatVO.getMobile());
|
|
|
if (null != swsVerInfoCheck) {
|
|
|
- if (DateUtil.after(DateUtil.addMinutes(swsVerInfoCheck.getCreateTime(), 3000), //TODO 方便测试先加大时间间隔
|
|
|
+ if (DateUtil.after(DateUtil.addMinutes(swsVerInfoCheck.getCreateTime(), ConstantEnum.SMS_EXPIRED_INTERVAL.getKey()),
|
|
|
DateUtil.now())) {
|
|
|
throw new CommonException(ServiceErrorCode.SMS_SEND_ERROR,
|
|
|
"同一用户三分钟之内不能重复发送验证短信,请三分钟之后再次发送!");
|