Skip to content

Commit

Permalink
♻️ Refactor biometric authentication logic in App.vue file
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed May 12, 2024
1 parent f8961bf commit d685d82
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,24 @@ const authSuccess = () => {
})
}
// 逻辑区域
// 获取生物识别信息
WebAppBiometricManager.initBiometric(
() => {
console.log('Biometric initialized')
if (WebAppBiometricManager.isBiometricAvailable.value) {
console.log('Biometric now available')
console.log(WebAppBiometricManager.biometricType.value)
isBiometricInitialized.value = true
} else {
console.log('Biometric now unavailable')
isBiometricInitialized.value = false
}
// 再次设置验证类型
}
)
// 授权
if (WebAppBiometricManager.isBiometricAccessGranted.value) {
console.log('Biometric granted')
Expand All @@ -175,21 +193,6 @@ if (WebAppBiometricManager.isBiometricAccessGranted.value) {
)
}
// 获取生物识别信息
WebAppBiometricManager.initBiometric(
() => {
console.log('Biometric initialized')
if (WebAppBiometricManager.isBiometricAvailable.value) {
console.log('Biometric now available')
console.log(WebAppBiometricManager.biometricType.value)
isBiometricInitialized.value = true
} else {
console.log('Biometric now unavailable')
isBiometricInitialized.value = false
}
// 再次设置验证类型
}
)
console.log(getUserAcc())
WebApp.ready()
Expand Down

0 comments on commit d685d82

Please sign in to comment.