This commit is contained in:
hailin 2025-04-17 09:53:50 +08:00
parent 5b4116dfe7
commit 138daa7458
1 changed files with 2 additions and 1 deletions

View File

@ -13,12 +13,13 @@ export default function HomeRedirector() {
if (
preferred &&
i18nConfig.locales.includes(preferred) &&
(i18nConfig.locales as string[]).includes(preferred) &&
!currentPath.startsWith(`/${preferred}/`)
) {
const newPath = `/${preferred}${currentPath}`
router.replace(newPath)
}
}, [])
return null