This commit is contained in:
hailin 2025-05-20 16:30:45 +08:00
parent cf98a73e79
commit 3c128425d9
1 changed files with 4 additions and 1 deletions

View File

@ -34,7 +34,10 @@ export default function WorkspaceLayout({ children }: WorkspaceLayoutProps) {
const pathname = usePathname() // 获取当前路径 const pathname = usePathname() // 获取当前路径
// 提取当前路径中的 locale 部分 // 提取当前路径中的 locale 部分
const locale = pathname.split("/")[1] || "en" //const locale = pathname.split("/")[1] || "en"
const match = pathname.match(/^\/([a-z]{2})(\/|$)/)
const locale = match ? match[1] : "en"
const params = useParams() const params = useParams()
const searchParams = useSearchParams() const searchParams = useSearchParams()