This commit is contained in:
parent
829a5f8a17
commit
d47b1d0932
|
|
@ -54,7 +54,7 @@ export const GlobalState: FC<GlobalStateProps> = ({ children }) => {
|
||||||
if (locales.includes(segment)) {
|
if (locales.includes(segment)) {
|
||||||
locale = segment
|
locale = segment
|
||||||
}
|
}
|
||||||
const homePath = locale === defaultLocale ? "/" : `${locale}`
|
const homePath = locale === defaultLocale ? "/" : `/${locale}`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -187,15 +187,12 @@ export const GlobalState: FC<GlobalStateProps> = ({ children }) => {
|
||||||
setProfile(profile)
|
setProfile(profile)
|
||||||
|
|
||||||
if (!profile.has_onboarded) {
|
if (!profile.has_onboarded) {
|
||||||
// 提取当前路径中的 locale 部分
|
|
||||||
// const locale = pathname.split("/")[1] || "en" // 获取路径中的 locale 部分,如果没有则默认为 "en"
|
|
||||||
|
|
||||||
// 强制跳转到带有 locale 的 setup 页面
|
// 强制跳转到带有 locale 的 setup 页面
|
||||||
console.log("[global-state.tsx]-------------", `${homePath}/setup`)
|
console.log("[global-state.tsx]-------------", `${homePath}/setup`)
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
router.push(`${homePath}/setup`)
|
router.push(`${homePath}/setup`)
|
||||||
}, 10 * 1000) // 10秒 = 10000毫秒
|
}, 20 * 1000) // 20秒 = 20000毫秒
|
||||||
|
|
||||||
// return router.push(`${homePath}/setup`)
|
// return router.push(`${homePath}/setup`)
|
||||||
// return router.push(`/${locale}/setup`)
|
// return router.push(`/${locale}/setup`)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue