更新记录
1.0.1(2025-05-03)
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[Unreleased]
Added
Changed
Fixed
Deprecated
Removed
Security
[1.0.1] - 2025-05-03
Fixed
[1.0.0] - 2025-04-01
Initial Release
- 插件核心功能上线:支持基础 API 调用和 UI 渲染。
1.0.0(2025-05-03)
[1.0.0] - 2025-04-01
Initial Release
- 插件核心功能上线:支持基础 API 调用和 UI 渲染。
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 4.64,Android:6.0,iOS:13,HarmonyNext:不确定 |
× |
× |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
鸿蒙元服务 |
× |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
× |
× |
× |
× |
× |
× |
× |
× |
× |
📦 安装
npm install alipay-face --save
🚀 快速开始
初始化 SDK
import { initSDK } from 'alipay-face';
const result = initSDK(3);
console.log('初始化状态:', result.status);
调用人脸核身
import { verify } from 'alipay-face';
verify({
certifyId: 'your_certify_id_from_alipay',
success: (res) => {
console.log('核身成功:', res);
},
fail: (err) => {
console.error('核身失败:', err.errCode, err.errMsg);
}
});
📚 API 文档
initSDK(retryCount: number): InitResult
参数 |
类型 |
必填 |
说明 |
retryCount |
number |
是 |
最大重试次数 |
返回值:
interface InitResult {
status: boolean
}
verify(options: VerifyOptions): void
参数结构:
interface VerifyOptions {
certifyId: string
success?: (res: VerifyResult) => void
fail?: (err: VerifyFail) => void
complete?: (res: any) => void
}
interface VerifyResult {
code: number
reason: string
retCode: number
retMsg: string
}
interface VerifyFail extends IUniError {
errCode: 9010001 | 9010002
}
⚠️ 错误码说明
错误码 |
描述 |
9010001 |
核身流程ID无效 |
9010002 |
支付宝SDK初始化失败 |
🔧 集成准备
支付宝配置
- 登录支付宝开放平台
- 添加「人脸核身」功能
- 获取
certifyId
Uni-App 配置
{
"app-plus": {
"plugins": {
"alipay-face": {
"version": "1.0.0",
"provider": "alipay"
}
}
}
}
📝 注意事项
- Android需相机权限
- iOS需添加 NSCameraUsageDescription
- 建议使用沙箱环境测试
📜 许可证
MIT © 2023 MiKoo NetWrok