diff --git a/components/SearchInput.js b/components/SearchInput.js index 03519aa4..18bd9d29 100644 --- a/components/SearchInput.js +++ b/components/SearchInput.js @@ -1,6 +1,6 @@ import React, { useState } from 'react' import { useLocale } from '@/lib/locale' -import Router, { useRouter } from 'next/router' +import { useRouter } from 'next/router' const SearchInput = ({ currentTag }) => { const locale = useLocale() @@ -8,12 +8,12 @@ const SearchInput = ({ currentTag }) => { const [searchValue, setSearchValue] = useState('') const handleSearch = () => { if (searchValue && searchValue !== '') { - Router.push({ pathname: '/page/1', query: { s: searchValue } }).then(r => { - console.log(r) + router.push({ pathname: '/', query: { s: searchValue } }).then(r => { + router.reload() }) } else { - Router.push({ pathname: '/' }).then(r => { - console.log(r) + router.push({ pathname: '/' }).then(r => { + router.reload() }) } } diff --git a/pages/article/[slug].js b/pages/article/[slug].js index ff0cf109..ac6f9371 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -43,7 +43,7 @@ const BlogPost = ({ post, blockMap, tags, prev, next, posts }) => { {/* 阅读进度条 */} -