From 10a362ccff15a7efd7cc1b242790b0243f623951 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 29 十二月 2025 17:04:50 +0800
Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/flexJobMiniApp
---
packages/hooks/identify.ts | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/packages/hooks/identify.ts b/packages/hooks/identify.ts
index 49aced2..5db5d8e 100644
--- a/packages/hooks/identify.ts
+++ b/packages/hooks/identify.ts
@@ -1,42 +1,42 @@
-import * as accountServices from '@12333/services/api/Account';
-import * as commonServices from '@12333/services/api/Common';
+import { EnumOcrAccess } from '@12333/constants';
+import * as ocrUtilsServices from '@12333/services/apiV2/ocrUtils';
import { FileItem } from '@nutui/nutui-taro/dist/types/__VUE/uploader/type';
import _ from 'lodash';
type VatLicenseOptions = {
- onSuccess?: (res: API.LicenseOcrModel) => any;
+ onSuccess?: (res: API.BaiduOcrBusinessLicenseResultModel) => any;
};
export async function vatLicense(response: FileItem, options: VatLicenseOptions = {}) {
try {
if (response?.url) {
const { onSuccess } = options;
- let res = await accountServices.vatLicense({
+ let res = await ocrUtilsServices.getLicenseOcr({
url: response.url,
});
- onSuccess?.(
- _.mapValues(res, (x) => {
- if (x === '鏃�') return '';
- return x;
- })
- );
+ onSuccess?.(res.model);
}
} catch (error) {}
}
type UserCredentialVerifyOcrIDCardOptions = {
- onSuccess?: (res: API.UserCredentialVerifyOcrIDCardResponse) => any;
+ access?: EnumOcrAccess;
+ scene?: string;
+ isOssUrl?: boolean;
+ url?: string;
+ onSuccess?: (res: API.GetIdentityFrontOcrCommandResult) => any;
};
export async function userCredentialVerifyOcrIDCard(
- response: FileItem,
options: UserCredentialVerifyOcrIDCardOptions = {}
) {
try {
- if (response?.url) {
- const { onSuccess } = options;
- let res = await commonServices.userCredentialVerifyOcrIDCard({
- identityImageUrl: response.url,
+ const { onSuccess, access, isOssUrl, url, scene } = options;
+ if (url) {
+ let res = await ocrUtilsServices.getIdentityFrontOcr({
+ access: access,
+ url: url,
+ isOssUrl: isOssUrl,
});
onSuccess?.(res);
}
--
Gitblit v1.10.0