| import * as ocrUtilsServices from '@/services/api/ocrUtils'; | 
| import { UploadUserFile } from '@bole-core/components'; | 
| import _ from 'lodash'; | 
|   | 
| type VatLicenseOptions = { | 
|   onSuccess?: (res: API.BaiduOcrBusinessLicenseResultModel) => any; | 
| }; | 
|   | 
| export async function vatLicense(response: UploadUserFile, options: VatLicenseOptions = {}) { | 
|   try { | 
|     if (response?.url) { | 
|       const { onSuccess } = options; | 
|       let res = await ocrUtilsServices.getLicenseOcr({ | 
|         url: response.url, | 
|       }); | 
|       onSuccess?.(res.model); | 
|     } | 
|   } catch (error) {} | 
| } | 
|   | 
| type UserCredentialVerifyOcrIDCardOptions = { | 
|   access?: EnumOcrAccess; | 
|   scene?: string; | 
|   isOssUrl?: boolean; | 
|   url?: string; | 
|   onSuccess?: (res: API.BaiduOcrIdentityFrontResultModel) => any; | 
| }; | 
|   | 
| 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.model); | 
|     } | 
|   } catch (error) {} | 
| } |