Skip to content

Commit

Permalink
✨ feat(frontend): Add authSuccess function
Browse files Browse the repository at this point in the history
ℹ️ Add authSuccess function to send data to the backend and represent successful validation.从环境变量获取后端地址
  • Loading branch information
sudoskys committed May 12, 2024
1 parent 35f5570 commit 3bc3c02
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,26 @@ const authSuccess = () => {
axios.post(backendUrl, requestBody)
.then((response) => {
console.log('Response:', response)
verifyBackendMessage.success = true
verifyBackendMessage.message = 'Backend verification success'
// 延迟几秒
setTimeout(() => {
WebApp.close()
}, 3000)
if (response.status === 200) {
verifyBackendMessage.success = true
verifyBackendMessage.message = 'Backend verification success'
// 延迟几秒
setTimeout(() => {
WebApp.close()
}, 3000)
} else {
console.error('Error:', response)
verifyBackendMessage.success = false
verifyBackendMessage.message = 'Backend verification failed'
}
})
.catch((error) => {
console.error('Error:', error)
verifyBackendMessage.success = false
verifyBackendMessage.message = 'Backend verification failed'
verifyBackendMessage.message = 'Backend verification error'
})
}
// 授权
if (WebAppBiometricManager.isBiometricAccessGranted) {
console.log('Biometric granted')
Expand Down

0 comments on commit 3bc3c02

Please sign in to comment.