From a69bf92c8907eb1fed227afb156ff0e1c5821c24 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期日, 19 十月 2025 16:16:12 +0800
Subject: [PATCH] fix: bug
---
packages/hooks/identify.ts | 42 ++++++++++++++++++++++++------------------
1 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/packages/hooks/identify.ts b/packages/hooks/identify.ts
index 8981b94..63b0a62 100644
--- a/packages/hooks/identify.ts
+++ b/packages/hooks/identify.ts
@@ -1,5 +1,6 @@
+import { EnumOcrAccess } from '@12333/constants';
import * as accountServices from '@12333/services/api/Account';
-import * as commonServices from '@12333/services/api/Common';
+import * as ocrUtilsServices from '@12333/services/apiV2/ocrUtils';
import { FileItem } from '@nutui/nutui-taro/dist/types/__VUE/uploader/type';
import _ from 'lodash';
@@ -24,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