404页面检测文章加载;
Page类型排版微调
This commit is contained in:
tangly1024
2021-12-01 13:23:03 +08:00
parent 2b2ac12ce3
commit 3d02abf98e
4 changed files with 66 additions and 66 deletions

View File

@@ -11,8 +11,14 @@ import { useRouter } from 'next/router'
export default function Custom404 () {
const router = useRouter()
useEffect(() => {
// 延时3秒如果加载失败就返回首页
setTimeout(() => {
router.push('/')
if (window) {
const article = document.getElementById('article-wrapper')
if (!article) {
router.push('/')
}
}
}, 3000)
})