登录异常信息日志

master
taylor.dang 6 years ago
parent 2291ddcede
commit 1ad4c6ec52

@ -69,4 +69,15 @@ public class RetailLoginInfo {
public void setDevId(String devId) { public void setDevId(String devId) {
this.devId = devId; this.devId = devId;
} }
@Override
public String toString() {
return "RetailLoginInfo{" +
"loginId='" + loginId + '\'' +
", password='" + password + '\'' +
", verifyCode='" + verifyCode + '\'' +
", captchaKey='" + captchaKey + '\'' +
", devId='" + devId + '\'' +
'}';
}
} }

@ -12,6 +12,8 @@ import com.alibaba.fastjson.JSONObject;
import com.google.code.kaptcha.Producer; import com.google.code.kaptcha.Producer;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -28,6 +30,7 @@ import java.io.IOException;
@RestController @RestController
@RequestMapping("/api/v1.0/retail_valid") @RequestMapping("/api/v1.0/retail_valid")
public class RetailValidationController { public class RetailValidationController {
Logger logger = LoggerFactory.getLogger(getClass());
@Resource @Resource
private Producer captchaProducer; private Producer captchaProducer;
@Resource @Resource
@ -47,6 +50,7 @@ public class RetailValidationController {
HttpUtils.handleValidErrors(errors); HttpUtils.handleValidErrors(errors);
String codeValue = signInStatusManager.getVerifyCode(loginInfo.getCaptchaKey()); String codeValue = signInStatusManager.getVerifyCode(loginInfo.getCaptchaKey());
if (codeValue == null) { if (codeValue == null) {
logger.error("异常商户信息:" + loginInfo.toString());
throw new BadRequestException("Verification code has expired"); throw new BadRequestException("Verification code has expired");
} }
if (!codeValue.equals(loginInfo.getVerifyCode())) { if (!codeValue.equals(loginInfo.getVerifyCode())) {

Loading…
Cancel
Save