diff --git a/components/ui/language-switcher.tsx b/components/ui/language-switcher.tsx index 295c096..b841a95 100644 --- a/components/ui/language-switcher.tsx +++ b/components/ui/language-switcher.tsx @@ -39,13 +39,19 @@ export function LanguageSwitcher() { const newPath = '/' + segments.join('/') - startTransition(() => { - if (pathname !== newPath) { - router.push(newPath) - } else { - router.refresh() - } - }) + + // 🔥 核心修复:延迟 router.push,确保 cookie 写入完成再跳转 + setTimeout(() => { + startTransition(() => { + if (pathname !== newPath) { + router.push(newPath) + } else { + router.refresh() + } + }) + }, 0) + + } return (