Commit 5da3ef54 authored by muhong's avatar muhong

修改 小程序手机号格式校验

parent aedca6c6
......@@ -168,9 +168,6 @@ public class UserServiceImpl implements UserService {
@Override
public Result regCaptcha(UserRequestDto dto) {
try {
if (!RegexUtil.isMobileExact(dto.getMobile())) {
return Result.failed("手机号格式不正确");
}
if (!notifyService.isSmsEnable()) {
logger.error("请求验证码出错:{}", WxResponseCode.AUTH_CAPTCHA_UNSUPPORT.desc());
return Result.failed(WxResponseCode.AUTH_CAPTCHA_UNSUPPORT.desc());
......@@ -178,6 +175,9 @@ public class UserServiceImpl implements UserService {
String activeProfile = applicationContext.getEnvironment().getActiveProfiles()[0];
String code = "123456";
if (!StringUtils.equals("dev", activeProfile)) {
if (!RegexUtil.isMobileExact(dto.getMobile())) {
return Result.failed("手机号格式不正确");
}
code = CharUtil.getRandomNum(6);
SmsResult smsResult = notifyService.notifySmsTemplate(dto.getMobile(), NotifyType.CAPTCHA, new String[]{code, "1"});
if (smsResult != null) {
......
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