前言
最近项目有一个指纹登录的功能,做个记录。
一、uniapp 生物认证(指纹或者面容ID)
https://uniapp.dcloud.io/api/system/authentication
二、流程图
1.manifest.json勾选配置
2.调用官方api
-
第一步:uni.checkIsSupportSoterAuthentication: 获取本机支持认证方式,res.supportMode = [‘fingerPrint’] 只支持指纹识别,res.supportMode = [‘fingerPrint’, ‘facial’] 支持指纹识别和人脸识别。
-
第二步: uni.checkIsSoterEnrolledInDevice : 获取设备内是否录入指纹信息
-
第三步:uni.startSoterAuthentication开始 SOTER 生物认证
<template>
<view>
<view>{
{
result }}</view>
</view>
</template>
<script>
export default {
data() {
return {
result: ''
}
},
onLoad() {
this.checkIsSupportSoterAuthentication()
}