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