This commit is contained in:
parent
de1faa3d27
commit
7314da256b
|
|
@ -191,11 +191,10 @@ export const GlobalState: FC<GlobalStateProps> = ({ children }) => {
|
||||||
const homePath = locale === defaultLocale ? "" : `/${locale}`
|
const homePath = locale === defaultLocale ? "" : `/${locale}`
|
||||||
const targetPath = `${homePath}/setup`
|
const targetPath = `${homePath}/setup`
|
||||||
|
|
||||||
console.log("[global-state.tsx]-------------", targetPath)
|
// console.log("[global-state.tsx]-------------", targetPath)
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
router.push(targetPath)
|
router.push(targetPath)
|
||||||
}, 20 * 1000) // 20秒 = 20000毫秒
|
|
||||||
|
|
||||||
// return router.push(`${homePath}/setup`)
|
// return router.push(`${homePath}/setup`)
|
||||||
// return router.push(`/${locale}/setup`)
|
// return router.push(`/${locale}/setup`)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export default function HomeRedirector() {
|
||||||
const preferred = localStorage.getItem('preferred-language')
|
const preferred = localStorage.getItem('preferred-language')
|
||||||
const currentPath = window.location.pathname
|
const currentPath = window.location.pathname
|
||||||
|
|
||||||
console.log('[HomeRedirector] localStorage preferred:', preferred)
|
console.log('[HomeRedirector] localStorage preferred-language:', preferred)
|
||||||
|
|
||||||
if (!preferred || !isValidLocale(preferred)) {
|
if (!preferred || !isValidLocale(preferred)) {
|
||||||
return
|
return
|
||||||
|
|
@ -37,7 +37,7 @@ export default function HomeRedirector() {
|
||||||
// console.log('[HomeRedirector] Redirecting to:', newPath)
|
// console.log('[HomeRedirector] Redirecting to:', newPath)
|
||||||
router.replace(newPath)
|
router.replace(newPath)
|
||||||
} else {
|
} else {
|
||||||
console.log('[HomeRedirector] Skipping redirect.')
|
console.log('[HomeRedirector] Skipping redirect......')
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue