diff --git a/components/Common.vue b/components/Common.vue index 8b78494..cd92598 100644 --- a/components/Common.vue +++ b/components/Common.vue @@ -109,8 +109,8 @@ export default { this.isHasKey = true } - const {keys} = keyPage - this.isHasKey = keys.indexOf(sessionStorage.getItem('key')) > -1 + const keys = keyPage.keys + this.isHasKey = keys && keys.indexOf(sessionStorage.getItem('key')) > -1 }, methods: { diff --git a/components/Password.vue b/components/Password.vue index 5bf029c..902dec2 100644 --- a/components/Password.vue +++ b/components/Password.vue @@ -67,8 +67,8 @@ export default { }, isHasKey () { const keyPage = this.$site.themeConfig.keyPage - const {keys} = keyPage - return keys.indexOf(sessionStorage.getItem('key')) > -1 + const keys = keyPage.keys + return keys && keys.indexOf(sessionStorage.getItem('key')) > -1 }, inputFocus () { this.warningText = 'Input Your Key'