This commit is contained in:
parent
cf98a73e79
commit
3c128425d9
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue