Commit dd90c196 by sdif

手机验证码登录

parent 98d8542c
...@@ -69,7 +69,7 @@ public class CaptchaController { ...@@ -69,7 +69,7 @@ public class CaptchaController {
map.put("code", code); map.put("code", code);
SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.TENCENT); SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.TENCENT);
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map); SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
if (!"OK".equals(smsResponse.getCode())) { if (!"Ok".equals(smsResponse.getCode())) {
log.error("验证码短信发送异常 => {}", smsResponse); log.error("验证码短信发送异常 => {}", smsResponse);
return R.fail(smsResponse.getMessage()); return R.fail(smsResponse.getMessage());
} }
......
...@@ -226,8 +226,7 @@ public class SysLoginService { ...@@ -226,8 +226,7 @@ public class SysLoginService {
* 校验短信验证码 * 校验短信验证码
*/ */
private boolean validateSmsCode(String phonenumber, String smsCode) { private boolean validateSmsCode(String phonenumber, String smsCode) {
// String code = RedisUtils.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + phonenumber); String code = RedisUtils.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + phonenumber);
String code = "1234";
if (StringUtils.isBlank(code)) { if (StringUtils.isBlank(code)) {
recordLogininfor(phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); recordLogininfor(phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
throw new CaptchaExpireException(); throw new CaptchaExpireException();
......
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