微信小程序调用指纹验证共有三个相关的接口
1.wx.checkIsSupportSoterAuthentication() 获取本机支持的 SOTER 生物认证方式
wx.checkIsSupportSoterAuthentication({
success(res) {
// res.supportMode = [] 不具备任何被SOTER支持的生物识别方式
// res.supportMode = ['fingerPrint'] 只支持指纹识别
// res.supportMode = ['fingerPrint', 'facial'] 支持指纹识别和人脸识别
}
})
2.wx.checkIsSoterEnrolledInDevice() 获取设备内是否录入如指纹等生物信息的接口
wx.checkIsSoterEnrolledInDevice({
checkAuthMode: 'fingerPrint',
success(res) {
console.log(res.isEnrolled)// isEnrolled的值是0或者1,不知道是不是指纹个数或是Boolean
} })
3.wx.startSoterAuthentication() 开始 SOTER 生物认证
wx.startSoterAuthentication({
requestAuthModes: ['fingerPrint'],
challenge: '123456',
authContent: '请用指纹解锁',
success(res) {
}
})
如果只是简单的验证指纹功能,可以只到这一步了
但是要做防止在客户端被破解,还需要后台进行向小程序后台进行api验证

相关链接:
https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.startSoterAuthentication.html
后续补充项目实践代码......