记得上下班打卡 | git大法好,push需谨慎

Commit c09b66a8 authored by zhanggb's avatar zhanggb

fix:实名认证服务商CODE处理;

parent d9898212
...@@ -4,6 +4,7 @@ import org.slf4j.Logger; ...@@ -4,6 +4,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import org.springframework.web.client.UnknownHttpStatusCodeException;
public class IdentityUtils { public class IdentityUtils {
private static final Logger log = LoggerFactory.getLogger(IdentityUtils.class); private static final Logger log = LoggerFactory.getLogger(IdentityUtils.class);
...@@ -20,6 +21,11 @@ public class IdentityUtils { ...@@ -20,6 +21,11 @@ public class IdentityUtils {
return HttpUtil.post(aliThirdUrl, params, header); return HttpUtil.post(aliThirdUrl, params, header);
} catch (Exception e) { } catch (Exception e) {
log.error("###实名认证异常:{}", e.getLocalizedMessage(), e); log.error("###实名认证异常:{}", e.getLocalizedMessage(), e);
if (e instanceof UnknownHttpStatusCodeException) {
UnknownHttpStatusCodeException unknownHttpStatusCodeException = (UnknownHttpStatusCodeException) e;
return unknownHttpStatusCodeException.getMessage();
}
return null; return null;
} }
} }
......
...@@ -343,7 +343,7 @@ public class AdamLoginController { ...@@ -343,7 +343,7 @@ public class AdamLoginController {
reql = Long.parseLong(otpDecrypt.substring(11)); reql = Long.parseLong(otpDecrypt.substring(11));
} catch (Exception e) { } catch (Exception e) {
} }
if (l - reql > 3 || (null != otpDecrypt && !otpDecrypt.substring(0, 10).equals(mobile))) { if (l - reql > 10 || (null != otpDecrypt && !otpDecrypt.substring(0, 10).equals(mobile))) {
log.error("login by silent for mobile:{},{}/{},{}-{}", mobile, otp, otpDecrypt, l, reql); log.error("login by silent for mobile:{},{}/{},{}-{}", mobile, otp, otpDecrypt, l, reql);
return ResponseDto.failure(ErrorMapping.get("10005")); return ResponseDto.failure(ErrorMapping.get("10005"));
} }
......
...@@ -246,11 +246,17 @@ public class AdamRdmService { ...@@ -246,11 +246,17 @@ public class AdamRdmService {
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
String respStr = IdentityUtils.aliThird(name, idCard); String respStr = IdentityUtils.aliThird(name, idCard), respErrorCode = null;
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class); JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"0".equals(respJNode.get("error_code").asText())) { if (null == respJNode || !"0".equals(respErrorCode = String.valueOf(respJNode.get("error_code")))) {
log.info("###实名认证失败[{}]", respStr); log.info("###实名认证失败[{}]", respStr);
this.setCertificationJunk(1, idCard, name);
// this.setCertificationJunk(1, idCard, name);
if (!StringUtils.isEmpty(respErrorCode) && org.apache.commons.lang3.StringUtils.indexOf("3000290033", respErrorCode) < 0) {
// 认证服务商'30002'、'90033'为运营商导致的失败,这里不做缓存标记
this.setCertificationJunk(1, idCard, name);
}
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
......
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