FengChaoYu 3 місяців тому
батько
коміт
642e71c5e3

+ 1 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/user/WorkerController.java

@@ -153,4 +153,5 @@ public class WorkerController {
         Boolean result = workerLogic.ocrHandwriting(file, signFile, type);
         return ResponseHelper.success(result);
     }
+
 }

+ 1 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/policy/WorkerLogic.java

@@ -642,4 +642,5 @@ public class WorkerLogic {
 
         return true;
     }
+
 }

+ 2 - 2
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/utils/ocr/OCRUtil.java

@@ -42,7 +42,7 @@ public class OCRUtil {
                                 // Endpoint 请参考 https://api.aliyun.com/product/ocr-api
                                 // 服务地址 ocr-api.cn-hangzhou.aliyuncs.com
                                 // VPC地址 ocr-api-vpc.cn-hangzhou.aliyuncs.com
-                                .setEndpointOverride("ocr-api-vpc.cn-hangzhou.aliyuncs.com")
+                                .setEndpointOverride("ocr-api.cn-hangzhou.aliyuncs.com")
                         //.setConnectTimeout(Duration.ofSeconds(30))
                 )
                 .build();
@@ -65,7 +65,7 @@ public class OCRUtil {
             final JSONObject data = JSONUtil.parseObj(body.getData());
             content = StrUtil.replace(data.get("content", String.class), " ", "");
         } catch (Exception e) {
-            throw new RemoteServiceException("OCR服务异常");
+            throw new RemoteServiceException("OCR服务异常" + e.getMessage());
         } finally {
             client.close();
         }