修复keys报错

This commit is contained in:
reco_luan 2019-04-09 14:45:24 +08:00
parent a1646763b6
commit 8367b622f7
2 changed files with 4 additions and 4 deletions

View File

@ -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: {

View File

@ -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'