mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 15:07:33 +08:00
fix the problem that the pin code can be set to other than 6 digits
This commit is contained in:
@@ -311,6 +311,7 @@ export default {
|
||||
'Unable to verify': 'Unable to verify',
|
||||
'Use a backup code': 'Use a backup code',
|
||||
'Use a passcode': 'Use a passcode',
|
||||
'PIN code is invalid': 'PIN code is invalid',
|
||||
'PIN code is wrong': 'PIN code is wrong',
|
||||
'Sign Up': 'Sign Up',
|
||||
'Transaction Details': 'Transaction Details',
|
||||
|
||||
@@ -311,6 +311,7 @@ export default {
|
||||
'Unable to verify': '无法验证',
|
||||
'Use a backup code': '使用备用码',
|
||||
'Use a passcode': '使用验证码',
|
||||
'PIN code is invalid': 'PIN码无效',
|
||||
'PIN code is wrong': 'PIN码错误',
|
||||
'Sign Up': '注册',
|
||||
'Transaction Details': '交易详情',
|
||||
|
||||
@@ -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