跳到主要内容

mgtv.certificateAuth(Object object)

功能描述

生物识别认证。

参数

Object object

属性类型默认值必填说明
namestring用户姓名
idNostring用户身份证号
typestringface生物识别认证类型 face/name/phone,暂只支持人脸识别(face)
stepnumber识别步骤数
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

object.success 回调函数

参数

Object res

属性类型说明
databoolean认证是否成功

示例代码

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}`
})
}
})