🐛 Fix locale duplicate prefix in layout

This commit is contained in:
2025-11-30 15:30:38 +08:00
parent 17bbae1ab2
commit 21952738fa

View File

@@ -161,8 +161,7 @@ const menuOptions = computed<MenuOption[]>(() => {
recentProducts.value?.map((product: any) => { recentProducts.value?.map((product: any) => {
const id = product.stem.split("/").pop(); const id = product.stem.split("/").pop();
const hasPage = product.hasPage; const hasPage = product.hasPage;
const localePrefix = locale.value == "en" ? "" : `/${locale.value}`; const url = hasPage ? `/products/${id}` : product.url;
const url = hasPage ? `${localePrefix}/products/${id}` : product.url;
return { return {
label: hasPage label: hasPage