This commit is contained in:
parent
a4b4081df4
commit
9b763db533
|
|
@ -37,12 +37,7 @@ export default function HomeRedirector() {
|
||||||
if (!hasLocaleInPath) {
|
if (!hasLocaleInPath) {
|
||||||
const newPath = `/${preferred}${currentPath}`
|
const newPath = `/${preferred}${currentPath}`
|
||||||
console.log('......[HomeRedirector] Redirecting to:', newPath)
|
console.log('......[HomeRedirector] Redirecting to:', newPath)
|
||||||
|
router.replace(newPath)
|
||||||
// 添加延迟跳转,延迟时间为 2 秒(2000 毫秒)
|
|
||||||
setTimeout(() => {
|
|
||||||
router.replace(newPath)
|
|
||||||
}, 2000) // 这里的 2000 毫秒是 2 秒的延时,你可以根据需要调整
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('......[HomeRedirector] Already has valid locale in path, skipping redirect.')
|
console.log('......[HomeRedirector] Already has valid locale in path, skipping redirect.')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue