|
@@ -1,67 +1,3 @@
|
|
|
-
|
|
|
-// export const verifyFingerprint = async()=> {
|
|
|
-// // if (!window.Fingerprint) {
|
|
|
-// // alert('设备不支持指纹或插件未加载');
|
|
|
-// // return;
|
|
|
-// // }
|
|
|
-// // window.Fingerprint.isAvailable(
|
|
|
-// // (result) => {
|
|
|
-// // console.log('生物识别可用类型:', result); // 例如:FACE 或 FINGERPRINT
|
|
|
-// // alert('生物识别可用类型:' + JSON.stringify(result));
|
|
|
-// // },
|
|
|
-// // (error) => {
|
|
|
-// // console.error('生物识别不可用或未注册', error);
|
|
|
-// // alert('生物识别不可用或未注册' + JSON.stringify(error));
|
|
|
-// // }
|
|
|
-// // );
|
|
|
-
|
|
|
-
|
|
|
-// // try {
|
|
|
-// // const result = await new Promise((resolve, reject) => {
|
|
|
-// // window.Fingerprint.show(
|
|
|
-// // {
|
|
|
-// // clientId: "com.example.app", // 安卓必填,随便写
|
|
|
-// // clientSecret: "123456", // 安卓必填,随便写 // ios必填,随便写
|
|
|
-// // disableBackup: false, // 是否禁用备用密码(false表示允许用户输入密码)
|
|
|
-// // localizedFallbackTitle: "使用密码登录", // 备用密码按钮文字
|
|
|
-// // localizedReason: "请验证指纹完成支付", // 弹窗提示信息
|
|
|
-// // },
|
|
|
-// // resolve,
|
|
|
-// // reject
|
|
|
-// // );
|
|
|
-// // });
|
|
|
-
|
|
|
-// // if (result) {
|
|
|
-// // alert('验证成功!你可以执行支付逻辑了');
|
|
|
-// // }
|
|
|
-// // } catch (error) {
|
|
|
-// // alert("验证失败:" + JSON.stringify(error));
|
|
|
-// // console.error(error);
|
|
|
-// // }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// // const { FaceId } = Plugins;
|
|
|
-// alert("开始验证")
|
|
|
-// // check if device supports Face ID or Touch ID
|
|
|
-// // FaceId.isAvailable().then(checkResult => {
|
|
|
-// // if(checkResult.value) {
|
|
|
-// // FaceId.auth().then(() => {
|
|
|
-// // console.log('authenticated');
|
|
|
-// // }).catch((error) => {
|
|
|
-// // // handle rejection errors
|
|
|
-// // alert("验证失败:" + JSON.stringify(error));
|
|
|
-// // console.error(error.message);
|
|
|
-// // });
|
|
|
-// // } else {
|
|
|
-// // alert("自定义回退身份验证在这里" + JSON.stringify(error));
|
|
|
-// // // use custom fallback authentication here
|
|
|
-// // }
|
|
|
-// // });
|
|
|
-
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
import { BiometricAuth, AndroidBiometryStrength } from '@aparajita/capacitor-biometric-auth';
|
|
|
|
|
|
export const verifyFingerprint = async()=> {
|