|
|
@ -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())) {
|
|
|
|