소스 검색

精减。

lighter 4 년 전
부모
커밋
d66bdfcaf2
2개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      pom.xml
  2. 1 3
      src/main/java/thyyxxk/wxservice_server/service/IdCardAnalyzeService.java

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>wxservice-server</artifactId>
-    <version>4.2</version>
+    <version>4.3</version>
     <name>wxservice-server</name>
     <description>server for wxservice-web</description>
 

+ 1 - 3
src/main/java/thyyxxk/wxservice_server/service/IdCardAnalyzeService.java

@@ -52,9 +52,7 @@ public class IdCardAnalyzeService {
         options.put("detect_direction", "false");
         options.put("detect_risk", "false");
         String idCardSide = "front";
-        byte[] file;
-        String content = param.getContent().split("base64,")[1];
-        file = Base64.getDecoder().decode(content);
+        byte[] file = Base64.getMimeDecoder().decode(param.getContent().split("base64,")[1]);
         JSONObject res = client.idcard(file, idCardSide, options);
         log.info("解析身份证图像结果:{}", res);
         if (1 == res.getInt("idcard_number_type")) {