Explorar o código

bugfix:3777 (测试环境)账号信息页(提测0323):上传律师资格证没有做校验

刘云鑫 hai 3 semanas
pai
achega
9a27a2920c

+ 4 - 13
alien-lawyer/src/main/java/shop/alien/lawyer/util/ai/LawyerLicenseVerifyUtil.java

@@ -98,29 +98,20 @@ public class LawyerLicenseVerifyUtil {
 
     private VerifyResult parseResult(JSONObject root) {
         Integer code = root.getInteger("code");
-        if (code == null || code != 0) {
-            String msg = root.getString("message");
-            log.warn("律师执业证核验接口业务错误:code={}, message={}", code, msg);
-            if (code != null && code == 422) {
-                return new VerifyResult(false, "提交资料不完整或格式有误,请检查执业证照片、头像与姓名后重试。");
-            }
-            if (StringUtils.hasText(msg)) {
-                return new VerifyResult(false, "执业证核验未通过:" + msg);
-            }
-            return new VerifyResult(false, "执业证核验未通过,请稍后重试。");
+        String msg = root.getString("message");
+        log.warn("律师执业证核验接口业务错误:code={}, message={}", code, msg);
+        if (code != null && code == 422) {
+            return new VerifyResult(false, "提交资料不完整或格式有误,请检查执业证照片、头像与姓名后重试。");
         }
-
         JSONObject data = root.getJSONObject("data");
         if (data == null) {
             log.warn("律师执业证核验返回 data 为空");
             return new VerifyResult(false, "执业证核验结果异常,请稍后重试。");
         }
-
         if (isPass(data)) {
             log.info("律师执业证核验通过");
             return new VerifyResult(true, null);
         }
-
         String userMessage = buildUserFacingFailure(data);
         log.warn("律师执业证核验未通过:{}", userMessage);
         return new VerifyResult(false, userMessage);