/** * 自定义404界面 * @returns {JSX.Element} * @constructor */ import { useRouter } from 'next/router' import { useEffect } from 'react' export default function Custom404 () { const route = useRouter() if (route.asPath.indexOf('/article') < 0 && route.asPath.indexOf('/404') < 0) { // article 重定向,处理旧文章链接迁移。 const redirectUrl = '/article' + route.asPath route.push(redirectUrl) } else { useEffect(() => { setTimeout(() => { window.location.href = '/' }, 3000) }) } return