代码如下
ceshi:function(){
if (wx.canIUse(‘checkIsSupportSoterAuthentication’)) {
wx.checkIsSupportSoterAuthentication({
success(res) {
if (res.supportMode[0] == ‘fingerPrint’) {
wx.startSoterAuthentication({
requestAuthModes: [‘fingerPrint’],
challenge: ‘123456’,
authContent: ‘请用指纹解锁’,
success(res) {
},
fail(res) {
console.log(‘用户取消了指纹识别,或调用出现错误’)
}
})
} else {
console.log(‘当前设备不支持指纹识别’)
}
}
})
}
}