mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-02 07:26:45 +00:00
主题,加密
This commit is contained in:
@@ -8,8 +8,8 @@ import { idToUuid } from 'notion-utils'
|
||||
import Router from 'next/router'
|
||||
import { isBrowser } from '@/lib/utils'
|
||||
import { getNotion } from '@/lib/notion/getNotion'
|
||||
import md5 from 'js-md5'
|
||||
import { getPageTableOfContents } from '@/lib/notion/getPageTableOfContents'
|
||||
import { createHash } from 'crypto'
|
||||
|
||||
/**
|
||||
* 根据notion的slug访问页面
|
||||
@@ -59,7 +59,10 @@ const Slug = props => {
|
||||
* @param {*} result
|
||||
*/
|
||||
const validPassword = passInput => {
|
||||
if (passInput && md5(post.slug + passInput) === post.password) {
|
||||
const encrypt = createHash('md5')
|
||||
.update(post.slug + passInput)
|
||||
.digest('hex').trim().toLowerCase()
|
||||
if (passInput && encrypt === post.password) {
|
||||
setLock(false)
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user