Merge remote-tracking branch 'origin/develop' into develop

master
luoyang 6 years ago
commit 02fd5da0cc

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

Loading…
Cancel
Save