mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-23 07:26:47 +00:00
修复404跳转bug
This commit is contained in:
@@ -24,19 +24,18 @@ const Slug = props => {
|
||||
const article = document.getElementById('container')
|
||||
if (!article) {
|
||||
router.push('/404').then(() => {
|
||||
console.log('找不到页面', router.asPath)
|
||||
console.warn('找不到页面', router.asPath)
|
||||
})
|
||||
}
|
||||
}
|
||||
}, 3000)
|
||||
})
|
||||
|
||||
return <p>Redirecting...</p>
|
||||
const meta = { title: `${props?.siteInfo?.title} | loading` }
|
||||
return <ThemeComponents.LayoutSlug {...props} showArticleInfo={true} meta={meta} />
|
||||
}
|
||||
|
||||
// 文章锁🔐
|
||||
const [lock, setLock] = useState(post.password && post.password !== '')
|
||||
console.log('lock 默认值', lock)
|
||||
useEffect(() => {
|
||||
if (post.password && post.password !== '') {
|
||||
setLock(true)
|
||||
|
||||
@@ -7,9 +7,8 @@ const Index = props => {
|
||||
const { keyword, siteInfo } = props
|
||||
const { locale } = useGlobal()
|
||||
const meta = {
|
||||
title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${
|
||||
siteInfo.title
|
||||
}`,
|
||||
title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${siteInfo.title
|
||||
}`,
|
||||
description: siteInfo.title,
|
||||
slug: 'search/' + (keyword || ''),
|
||||
type: 'website'
|
||||
@@ -111,7 +110,7 @@ async function filterByMemCache(allPosts, keyword) {
|
||||
indexContent = appendText(indexContent, properties, 'caption')
|
||||
})
|
||||
}
|
||||
// console.log('搜索是否命中缓存', page !== null, indexContent)
|
||||
console.log('搜索是否命中缓存', page !== null, indexContent)
|
||||
post.results = []
|
||||
let hitCount = 0
|
||||
for (const i in indexContent) {
|
||||
|
||||
Reference in New Issue
Block a user