实名认证提取魔法数字
This commit is contained in:
parent
21ac49f83c
commit
dfdabcbe1c
@ -43,6 +43,8 @@ public interface GlobalConstants {
|
|||||||
|
|
||||||
String STATUS_FIVE = "5";
|
String STATUS_FIVE = "5";
|
||||||
|
|
||||||
|
String REALNAME_VERIFY_SUCCESS_CODE = "10000";
|
||||||
|
|
||||||
// LONG 型常量
|
// LONG 型常量
|
||||||
Long LONG_MINUS_ONE = -1L;
|
Long LONG_MINUS_ONE = -1L;
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.cdp.product.security.exception.DecryptFailureException;
|
|||||||
import com.cdp.product.security.exception.EncryptFailureException;
|
import com.cdp.product.security.exception.EncryptFailureException;
|
||||||
import com.cdp.product.security.exception.SignFailureException;
|
import com.cdp.product.security.exception.SignFailureException;
|
||||||
import com.cdp.product.security.strategyImpl.SM2StrategyImpl;
|
import com.cdp.product.security.strategyImpl.SM2StrategyImpl;
|
||||||
|
import com.cdzy.common.enums.GlobalConstants;
|
||||||
import com.cdzy.common.ex.EbikeException;
|
import com.cdzy.common.ex.EbikeException;
|
||||||
import com.cdzy.common.secure.SecureComponent;
|
import com.cdzy.common.secure.SecureComponent;
|
||||||
import com.cdzy.common.secure.SecureSM2Component;
|
import com.cdzy.common.secure.SecureSM2Component;
|
||||||
@ -37,7 +38,11 @@ import javax.crypto.spec.SecretKeySpec;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.Base64;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证工具类
|
* 验证工具类
|
||||||
@ -183,7 +188,7 @@ public class VerifyUtil {
|
|||||||
throw new EbikeException("验证用户实名失败");
|
throw new EbikeException("验证用户实名失败");
|
||||||
}
|
}
|
||||||
String code = result.has("code") ? result.get("code").asText() : "";
|
String code = result.has("code") ? result.get("code").asText() : "";
|
||||||
if (!"10000".equals(code)) {
|
if (!GlobalConstants.REALNAME_VERIFY_SUCCESS_CODE.equals(code)) {
|
||||||
String message = result.has("message") ? result.get("message").asText() : "未知错误";
|
String message = result.has("message") ? result.get("message").asText() : "未知错误";
|
||||||
log.error("验证用户实名失败, code: {}, message: {}", code, message);
|
log.error("验证用户实名失败, code: {}, message: {}", code, message);
|
||||||
throw new EbikeException(message.replace("(", "").replace(")", ""));
|
throw new EbikeException(message.replace("(", "").replace(")", ""));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user