修改短信验证吗变为4位

parent ebc3aaee
...@@ -130,7 +130,7 @@ public class SmsController { ...@@ -130,7 +130,7 @@ public class SmsController {
if (expire >= EXPIRE_MINUTES - 1) { if (expire >= EXPIRE_MINUTES - 1) {
return JsonResult.buildSuccessResult("发送成功", null); return JsonResult.buildSuccessResult("发送成功", null);
} }
String randomCode = smsIsDebug ? "000000" : String.valueOf(random.nextInt(899999) + 100000); String randomCode = smsIsDebug ? "000000" : String.valueOf(random.nextInt(8999) + 1000);
String uniqueId = phoneNo + UUID.randomUUID().toString().replaceAll("-", ""); String uniqueId = phoneNo + UUID.randomUUID().toString().replaceAll("-", "");
List<String> newList = new ArrayList<>(); List<String> newList = new ArrayList<>();
newList.add(randomCode); newList.add(randomCode);
...@@ -164,7 +164,7 @@ public class SmsController { ...@@ -164,7 +164,7 @@ public class SmsController {
if (expire >= EXPIRE_MINUTES - 1) { if (expire >= EXPIRE_MINUTES - 1) {
return JsonResult.buildSuccessResult("发送成功", null); return JsonResult.buildSuccessResult("发送成功", null);
} }
String randomCode = smsIsDebug ? "000000" : String.valueOf(random.nextInt(899999) + 100000); String randomCode = smsIsDebug ? "0000" : String.valueOf(random.nextInt(8999) + 1000);
String uniqueId = phoneNo + UUID.randomUUID().toString().replaceAll("-", ""); String uniqueId = phoneNo + UUID.randomUUID().toString().replaceAll("-", "");
MsgParams message = new MsgParams(Collections.singletonList(4), phoneNo, "1", "4", Collections.singletonList(randomCode), uniqueId); MsgParams message = new MsgParams(Collections.singletonList(4), phoneNo, "1", "4", Collections.singletonList(randomCode), uniqueId);
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment