mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
【优化】SYSTEM:短信验证码前置补零对其endCode长度
This commit is contained in:
parent
4a0f1463ef
commit
0ba98742be
@ -67,7 +67,8 @@ public class SmsCodeServiceImpl implements SmsCodeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 创建验证码记录
|
// 创建验证码记录
|
||||||
String code = String.valueOf(randomInt(smsCodeProperties.getBeginCode(), smsCodeProperties.getEndCode() + 1));
|
String code = String.format("%0" + smsCodeProperties.getEndCode().toString().length() + "d",
|
||||||
|
randomInt(smsCodeProperties.getBeginCode(), smsCodeProperties.getEndCode() + 1));
|
||||||
SmsCodeDO newSmsCode = SmsCodeDO.builder().mobile(mobile).code(code).scene(scene)
|
SmsCodeDO newSmsCode = SmsCodeDO.builder().mobile(mobile).code(code).scene(scene)
|
||||||
.todayIndex(lastSmsCode != null && isToday(lastSmsCode.getCreateTime()) ? lastSmsCode.getTodayIndex() + 1 : 1)
|
.todayIndex(lastSmsCode != null && isToday(lastSmsCode.getCreateTime()) ? lastSmsCode.getTodayIndex() + 1 : 1)
|
||||||
.createIp(ip).used(false).build();
|
.createIp(ip).used(false).build();
|
||||||
|
Loading…
Reference in New Issue
Block a user