This commit is contained in:
parent
6cd0444bb0
commit
5bfd37141b
|
|
@ -34,8 +34,8 @@ export default function WorkspaceLayout({ children }: WorkspaceLayoutProps) {
|
||||||
const pathname = usePathname() // 获取当前路径
|
const pathname = usePathname() // 获取当前路径
|
||||||
|
|
||||||
// 提取当前路径中的 locale 部分
|
// 提取当前路径中的 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"
|
const locale = match ? match[1] : "en"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue