From 8367b622f7c148bcd5a6fbcf5bbd6bdfeecdcbe2 Mon Sep 17 00:00:00 2001 From: reco_luan Date: Tue, 9 Apr 2019 14:45:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dkeys=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Common.vue | 4 ++-- components/Password.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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'