mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
code refactor
This commit is contained in:
@@ -92,8 +92,6 @@
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
const self = this;
|
||||
|
||||
return {
|
||||
username: '',
|
||||
password: '',
|
||||
@@ -103,15 +101,16 @@ export default {
|
||||
logining: false,
|
||||
verifying: false,
|
||||
show2faSheet: false,
|
||||
twoFAVerifyType: 'passcode',
|
||||
twoFAVerifyTypeSwitchName: 'Use a backup code',
|
||||
allLanguages: self.$getAllLanguages()
|
||||
twoFAVerifyType: 'passcode'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
version() {
|
||||
return 'v' + this.$version();
|
||||
},
|
||||
allLanguages() {
|
||||
return this.$getAllLanguages();
|
||||
},
|
||||
isUserRegistrationEnabled() {
|
||||
return this.$isUserRegistrationEnabled();
|
||||
},
|
||||
@@ -125,6 +124,13 @@ export default {
|
||||
return !this.passcode;
|
||||
}
|
||||
},
|
||||
twoFAVerifyTypeSwitchName() {
|
||||
if (this.twoFAVerifyType === 'backupcode') {
|
||||
return 'Use a passcode';
|
||||
} else {
|
||||
return 'Use a backup code';
|
||||
}
|
||||
},
|
||||
currentLanguageName() {
|
||||
const currentLocale = this.$i18n.locale;
|
||||
let lang = this.$getLanguage(currentLocale);
|
||||
@@ -251,10 +257,8 @@ export default {
|
||||
switch2FAVerifyType() {
|
||||
if (this.twoFAVerifyType === 'passcode') {
|
||||
this.twoFAVerifyType = 'backupcode';
|
||||
this.twoFAVerifyTypeSwitchName = 'Use a passcode';
|
||||
} else {
|
||||
this.twoFAVerifyType = 'passcode';
|
||||
this.twoFAVerifyTypeSwitchName = 'Use a backup code';
|
||||
}
|
||||
},
|
||||
changeLanguage(locale) {
|
||||
|
||||
Reference in New Issue
Block a user