Commit dd90c196 by sdif

手机验证码登录

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