don't clear application lock when user token expired

This commit is contained in:
MaysWind
2020-11-25 00:21:44 +08:00
parent f9f1774215
commit 2c72ce5f5c
7 changed files with 85 additions and 47 deletions
+9 -2
View File
@@ -104,8 +104,8 @@ export default {
self.$showLoading();
self.$webauthn.registerCredential(
self.$user.getUserAppLockState(),
self.$user.getUserInfo(),
self.$user.getUserAppLockSecret(),
).then(({ id }) => {
self.$hideLoading();
@@ -160,7 +160,14 @@ export default {
return;
}
this.$user.encryptToken(pinCode);
const user = this.$user.getUserInfo();
if (!user || !user.username) {
this.$alert('An error has occurred');
return;
}
this.$user.encryptToken(user.username, pinCode);
this.$settings.setEnableApplicationLock(true);
this.isEnableApplicationLock = true;