From de1faa3d279dc017a1d0bad21407e2c31413d523 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 22 Apr 2025 20:49:58 +0800 Subject: [PATCH] . --- components/utility/global-state.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/utility/global-state.tsx b/components/utility/global-state.tsx index 829ea42..c977118 100644 --- a/components/utility/global-state.tsx +++ b/components/utility/global-state.tsx @@ -187,11 +187,14 @@ export const GlobalState: FC = ({ children }) => { setProfile(profile) if (!profile.has_onboarded) { - // 强制跳转到带有 locale 的 setup 页面 - console.log("[global-state.tsx]-------------", `${homePath}/setup`) + // 修正 homePath 拼接逻辑,避免 //setup 问题 + const homePath = locale === defaultLocale ? "" : `/${locale}` + const targetPath = `${homePath}/setup` + + console.log("[global-state.tsx]-------------", targetPath) setTimeout(() => { - router.push(`${homePath}/setup`) + router.push(targetPath) }, 20 * 1000) // 20秒 = 20000毫秒 // return router.push(`${homePath}/setup`)