mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-28 15:10:04 +00:00
fix(使所有主题的404能够正常运转): 同时让获取文章DOM节点也避免公告栏等其他位置的干扰
This commit is contained in:
@@ -255,7 +255,7 @@ const LayoutIndex = props => {
|
||||
// 重定向到指定文章
|
||||
router.push(index).then(() => {
|
||||
setTimeout(() => {
|
||||
const article = document.getElementById('notion-article')
|
||||
const article = document.querySelector('#article-wrapper #notion-article')
|
||||
if (!article) {
|
||||
console.log(
|
||||
'请检查您的Notion数据库中是否包含此slug页面: ',
|
||||
@@ -309,7 +309,7 @@ const LayoutSlug = props => {
|
||||
setTimeout(
|
||||
() => {
|
||||
if (isBrowser) {
|
||||
const article = document.getElementById('notion-article')
|
||||
const article = document.querySelector('#article-wrapper #notion-article')
|
||||
if (!article) {
|
||||
router.push('/404').then(() => {
|
||||
console.warn('找不到页面', router.asPath)
|
||||
|
||||
Reference in New Issue
Block a user