diff --git a/components/utility/global-state.tsx b/components/utility/global-state.tsx index 86d2b66..829ea42 100644 --- a/components/utility/global-state.tsx +++ b/components/utility/global-state.tsx @@ -54,7 +54,7 @@ export const GlobalState: FC = ({ children }) => { if (locales.includes(segment)) { locale = segment } - const homePath = locale === defaultLocale ? "/" : `${locale}` + const homePath = locale === defaultLocale ? "/" : `/${locale}` @@ -187,16 +187,13 @@ export const GlobalState: FC = ({ children }) => { setProfile(profile) if (!profile.has_onboarded) { - // 提取当前路径中的 locale 部分 - // const locale = pathname.split("/")[1] || "en" // 获取路径中的 locale 部分,如果没有则默认为 "en" - // 强制跳转到带有 locale 的 setup 页面 console.log("[global-state.tsx]-------------", `${homePath}/setup`) setTimeout(() => { router.push(`${homePath}/setup`) - }, 10 * 1000) // 10秒 = 10000毫秒 - + }, 20 * 1000) // 20秒 = 20000毫秒 + // return router.push(`${homePath}/setup`) // return router.push(`/${locale}/setup`) }