refactor(about): 重构关于页面路由为静态路径
将关于页面的查询参数路由改为静态路径结构,如/about/company 更新i18n消息中的链接路径 添加新的[section]页面处理逻辑 优化静态生成参数和错误处理
This commit is contained in:
@@ -169,12 +169,12 @@ export async function generateStaticParams() {
|
||||
try {
|
||||
const defaultLocale = LOCALES[0];
|
||||
const { products }: { products: Product[] } = await getProducts(defaultLocale);
|
||||
const validProducts = products.filter((product) => product.slug && product.title);
|
||||
const validProducts = products.filter((product) => product.slug.toString() && product.title);
|
||||
|
||||
return LOCALES.flatMap((locale) =>
|
||||
validProducts.map((product) => ({
|
||||
locale,
|
||||
slug: product.slug,
|
||||
slug: product.slug.toString(),
|
||||
}))
|
||||
);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user