From eacfb51a0957991cb2029c8d62f9b52e19451cff Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 24 Jul 2023 11:45:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E9=A2=98=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/global.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/global.js b/lib/global.js index 95c9614a..a080f270 100644 --- a/lib/global.js +++ b/lib/global.js @@ -72,7 +72,8 @@ export function GlobalContextProvider({ children }) { const currentIndex = THEMES.indexOf(theme) const newIndex = currentIndex < THEMES.length - 1 ? currentIndex + 1 : 0 const newTheme = THEMES[newIndex] - const query = { ...router.query, theme: newTheme } + const query = router.query + query.theme = newTheme router.push({ pathname: router.pathname, query }) return newTheme }