mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 15:10:14 +00:00
hotfix.修复无法用密码访问的bug
This commit is contained in:
@@ -90,7 +90,6 @@ export default async function getPageProperties(id, block, schema, authToken, ta
|
|||||||
properties.pageCover = mapImgUrl(block[id].value?.format?.page_cover, block[id].value) ?? ''
|
properties.pageCover = mapImgUrl(block[id].value?.format?.page_cover, block[id].value) ?? ''
|
||||||
properties.pageCoverThumbnail = mapImgUrl(block[id].value?.format?.page_cover, block[id].value, 'block', 'pageCoverThumbnail') ?? ''
|
properties.pageCoverThumbnail = mapImgUrl(block[id].value?.format?.page_cover, block[id].value, 'block', 'pageCoverThumbnail') ?? ''
|
||||||
properties.content = value.content ?? []
|
properties.content = value.content ?? []
|
||||||
properties.password = properties.password ? md5(properties.slug + properties.password) : ''
|
|
||||||
properties.tagItems = properties?.tags?.map(tag => {
|
properties.tagItems = properties?.tags?.map(tag => {
|
||||||
return { name: tag, color: tagOptions?.find(t => t.value === tag)?.color || 'gray' }
|
return { name: tag, color: tagOptions?.find(t => t.value === tag)?.color || 'gray' }
|
||||||
}) || []
|
}) || []
|
||||||
@@ -106,6 +105,7 @@ export default async function getPageProperties(id, block, schema, authToken, ta
|
|||||||
properties.to = properties.slug ?? null
|
properties.to = properties.slug ?? null
|
||||||
properties.name = properties.title ?? ''
|
properties.name = properties.title ?? ''
|
||||||
}
|
}
|
||||||
|
properties.password = properties.password ? md5(properties.slug + properties.password) : ''
|
||||||
|
|
||||||
return properties
|
return properties
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const Slug = props => {
|
|||||||
*/
|
*/
|
||||||
const validPassword = passInput => {
|
const validPassword = passInput => {
|
||||||
const encrypt = md5(post.slug + passInput)
|
const encrypt = md5(post.slug + passInput)
|
||||||
|
console.log('passInput', passInput, post.slug)
|
||||||
if (passInput && encrypt === post.password) {
|
if (passInput && encrypt === post.password) {
|
||||||
setLock(false)
|
setLock(false)
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user