@tauri-apps/plugin-biometric
枚举
生物识别类型
枚举成员
面部识别
FaceID: 2;
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L12
虹膜扫描
Iris: 3;
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L14
无
None: 0;
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L8
触摸ID
TouchID: 1;
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L10
接口
身份验证选项
属性
状态
属性
属性 | 类型 | 定义在 |
---|---|---|
biometryType | 生物识别类型 | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L19 |
error? | 字符串 | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L20 |
errorCode? | | "appCancel" | "authenticationFailed" | "invalidContext" | "notInteractive" | "passcodeNotSet" | "systemCancel" | "userCancel" | "userFallback" | "biometryLockout" | "biometryNotAvailable" | "biometryNotEnrolled" | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L21 |
isAvailable | 布尔值 | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L18 |
函数
authenticate()
function authenticate(reason, options?): Promise<void>
通过系统界面(触摸ID,面容ID或Android虹膜)提示用户进行身份验证。如果身份验证失败则拒绝。
import { authenticate } from "@tauri-apps/plugin-biometric";await authenticate('Open your wallet');
参数
参数 | 类型 | 描述 |
---|---|---|
原因 | 字符串 | |
选项 ? | 身份验证选项 |
返回值
Promise
<void
>
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L69
checkStatus()
function checkStatus(): Promise<Status>
检查生物识别身份验证是否可用。
返回值
一个解析为包含生物识别状态所有信息的对象的承诺。
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/biometric/guest-js/index.ts#L53
© 2025 Tauri贡献者。CC-BY / MIT