修复404跳转bug

This commit is contained in:
tangly1024
2022-04-13 13:05:20 +08:00
parent b122bab41d
commit f1a29575bd
14 changed files with 78 additions and 37 deletions

View File

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