fix: change password in source code to ciphertext

This commit is contained in:
reco_luan 2020-03-15 15:54:31 +08:00
parent c3bc7892dc
commit 31ab99fe62
2 changed files with 4 additions and 5 deletions

View File

@ -78,7 +78,6 @@
</template>
<script>
import md5 from 'md5'
import Navbar from '@theme/components/Navbar'
import Sidebar from '@theme/components/Sidebar'
import { resolveSidebarItems } from '@theme/helpers/utils'
@ -195,7 +194,7 @@ export default {
}
let { keys } = keyPage
keys = keys.map(item => md5(item))
keys = keys.map(item => item.toLowerCase())
this.isHasKey = keys && keys.indexOf(sessionStorage.getItem('key')) > -1
},
hasPageKey () {
@ -205,7 +204,7 @@ export default {
return
}
pageKeys = pageKeys.map(item => md5(item))
pageKeys = pageKeys.map(item => item.toLowerCase())
this.isHasPageKey = pageKeys.indexOf(sessionStorage.getItem(`pageKey${window.location.pathname}`)) > -1
},

View File

@ -104,11 +104,11 @@ export default {
},
isHasKey () {
let { keys } = this.$themeConfig.keyPage
keys = keys.map(item => md5(item))
keys = keys.map(item => item.toLowerCase())
return keys.indexOf(sessionStorage.getItem('key')) > -1
},
isHasPageKey () {
const pageKeys = this.$frontmatter.keys.map(item => md5(item))
const pageKeys = this.$frontmatter.keys.map(item => item.toLowerCase())
const pageKey = `pageKey${window.location.pathname}`
return pageKeys && pageKeys.indexOf(sessionStorage.getItem(pageKey)) > -1