diff --git a/src/locales/en.js b/src/locales/en.js index 70184142..a6f89f11 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -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', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 90083bc1..90e4412f 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -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': '交易详情', diff --git a/src/views/mobile/ApplicationLock.vue b/src/views/mobile/ApplicationLock.vue index afac2759..8284e7d0 100644 --- a/src/views/mobile/ApplicationLock.vue +++ b/src/views/mobile/ApplicationLock.vue @@ -38,7 +38,7 @@ - +
@@ -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;