Commit 434bf76c authored by shiyu's avatar shiyu

Merge remote-tracking branch 'origin/master'

parents fd150ee4 5da3ef54
......@@ -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) {
......
......@@ -78,6 +78,7 @@ public class WxLoginServiceImpl implements WxLoginService {
logger.error("获取手机号出错,返回结果是:" + phoneResult);
return "phoneFalse";
}
phone = JsonUtils.getValueByPath(phoneResult, "phone_info/phoneNumber");
} else {
logger.info("开始获取sessionKey-----------------------");
String sessionKey = "";
......
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