diff --git a/components/ui/language-switcher.tsx b/components/ui/language-switcher.tsx index 2745d56..088b03c 100644 --- a/components/ui/language-switcher.tsx +++ b/components/ui/language-switcher.tsx @@ -33,7 +33,7 @@ export function LanguageSwitcher() { const segments = pathname.split('/') // 如果路径前缀是语言码,则替换 - const isLocaleInPath = [...i18nConfig.locales].includes(segments[1]) + const isLocaleInPath = (i18nConfig.locales as string[]).includes(segments[1]) if (isLocaleInPath) { segments[1] = newLocale } else {