This commit is contained in:
hailin 2025-05-21 14:19:21 +08:00
parent 6cd0444bb0
commit 5bfd37141b
1 changed files with 2 additions and 2 deletions

View File

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