mgtv.certificateAuth(Object object)
功能描述
生物识别认证。
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
name | string | 是 | 用户姓名 | |
idNo | string | 是 | 用户身份证号 | |
type | string | face | 否 | 生物识别认证类型 face/name/phone,暂只支持人脸识别(face) |
step | number | 否 | 识别步骤数 | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
object.success 回调函数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
data | boolean | 认证是否成功 |
示例代码
mgtv.certificateAuth({
type: 'face',
name: '芒果',
idNo: '430100200001010001',
step: 3,
success (res) {
if (res.data) {
mgtv.showToast({
title: '认证成功'
})
} else {
mgtv.showToast({
title: '认证失败'
})
}
},
fail (res) {
mgtv.showToast({
title: `认证错误:${res.errMsg}`
})
}
})