|
@ -46,7 +46,7 @@ public class BaseSmsService extends BaseJpaService<SmsDO, BaseSmsDao>{
|
|
|
// 分页信息
|
|
|
PageRequest pageRequest = new PageRequest(0, 1, sort);
|
|
|
SmsTemplateDO.Type value = SmsTemplateDO.valueOf(type);
|
|
|
Page<SmsDO> page = baseSmsDao.findByCaptcha(mobile, captcha, value, pageRequest);
|
|
|
Page<SmsDO> page = baseSmsDao.findByCaptcha(mobile, value, pageRequest);
|
|
|
SmsDO sms = null;
|
|
|
for (SmsDO temp : page) {
|
|
|
if (temp != null) {
|
|
@ -58,8 +58,8 @@ public class BaseSmsService extends BaseJpaService<SmsDO, BaseSmsDao>{
|
|
|
if (sms == null) {
|
|
|
// 验证码错误
|
|
|
return -1;
|
|
|
} else if (type != sms.getType().ordinal()){
|
|
|
// 验证码无效,也视为错误
|
|
|
} else if (!sms.getCaptcha().equalsIgnoreCase(captcha)){
|
|
|
// 验证码错误
|
|
|
return -1;
|
|
|
} else if (sms.getDeadline().before(new Date())) {
|
|
|
// 验证码过期
|