From 8328df0f84dc6e24896d788166a67263ff029ae5 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期日, 19 十月 2025 14:38:50 +0800
Subject: [PATCH] Merge branch 'dev-1.2.0.1' of http://120.26.58.240:8888/r/flexJobMiniApp into dev-1.2.0.1
---
packages/hooks/identify.ts | 41 ++++++++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/packages/hooks/identify.ts b/packages/hooks/identify.ts
index a96f9d4..63b0a62 100644
--- a/packages/hooks/identify.ts
+++ b/packages/hooks/identify.ts
@@ -1,4 +1,6 @@
+import { EnumOcrAccess } from '@12333/constants';
import * as accountServices from '@12333/services/api/Account';
+import * as ocrUtilsServices from '@12333/services/apiV2/ocrUtils';
import { FileItem } from '@nutui/nutui-taro/dist/types/__VUE/uploader/type';
import _ from 'lodash';
@@ -23,21 +25,26 @@
} catch (error) {}
}
-// type UserCredentialVerifyOcrIDCardOptions = {
-// onSuccess?: (res: API.UserCredentialVerifyOcrIDCardResponse) => any;
-// };
+type UserCredentialVerifyOcrIDCardOptions = {
+ 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,
-// });
-// onSuccess?.(res);
-// }
-// } catch (error) {}
-// }
+export async function userCredentialVerifyOcrIDCard(
+ options: UserCredentialVerifyOcrIDCardOptions = {}
+) {
+ try {
+ const { onSuccess, access, isOssUrl, url, scene } = options;
+ if (url) {
+ let res = await ocrUtilsServices.getIdentityFrontOcr({
+ access: access,
+ url: url,
+ isOssUrl: isOssUrl,
+ });
+ onSuccess?.(res);
+ }
+ } catch (error) {}
+}
--
Gitblit v1.9.1