mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
fix the problem that the pin code can be set to other than 6 digits
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
<PincodeInput secure :length="6" v-model="currentPinCodeForEnable" />
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
<f7-button large fill :class="{ 'disabled': !currentPinCodeForEnable }" :text="$t('Continue')" @click="enable(currentPinCodeForEnable)"></f7-button>
|
||||
<f7-button large fill :class="{ 'disabled': !currentPinCodeValid }" :text="$t('Continue')" @click="enable(currentPinCodeForEnable)"></f7-button>
|
||||
<div class="margin-top text-align-center">
|
||||
<f7-link @click="showInputPinCodeSheetForEnable = false" :text="$t('Cancel')"></f7-link>
|
||||
</div>
|
||||
@@ -57,6 +57,11 @@ export default {
|
||||
showInputPinCodeSheetForEnable: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
currentPinCodeValid() {
|
||||
return this.currentPinCodeForEnable && this.currentPinCodeForEnable.length === 6;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
enable(pinCode) {
|
||||
if (!pinCode) {
|
||||
@@ -64,6 +69,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.currentPinCodeValid) {
|
||||
this.$alert('PIN code is invalid');
|
||||
return;
|
||||
}
|
||||
|
||||
this.$user.encryptToken(pinCode);
|
||||
this.$settings.setEnableApplicationLock(true);
|
||||
this.isEnableApplicationLock = true;
|
||||
|
||||
Reference in New Issue
Block a user