This commit is contained in:
hailin 2025-04-22 20:46:42 +08:00
parent 829a5f8a17
commit d47b1d0932
1 changed files with 3 additions and 6 deletions

View File

@ -54,7 +54,7 @@ export const GlobalState: FC<GlobalStateProps> = ({ 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<GlobalStateProps> = ({ 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`)
}