refactor: 将数据获取从app端移至server端

- 调整数据获取位置以提升安全性
- 对于后端状态为Archived的数据,通过server控制不进行获取
This commit is contained in:
2025-11-12 17:54:43 +08:00
parent 58223734a2
commit a5f3895794
37 changed files with 302 additions and 85 deletions

View File

@ -39,7 +39,7 @@
const { data, pending, error } = await useProduct(id);
const rawProduct = computed(() => data.value.products_by_id ?? null);
const rawProduct = computed(() => data.value ?? null);
const product = computed(() => {
if (rawProduct.value === null) {
@ -61,10 +61,10 @@
});
// SEO
// usePageSeo({
// title: product.value.name || $t('page-title.products'),
// description: product.value.summary || '',
// });
usePageSeo({
title: product.value.name || $t('page-title.products'),
description: product.value.summary || '',
});
</script>
<style scoped>

View File

@ -46,7 +46,7 @@
{ label: $t('navigation.products') },
];
const productsRaw = computed(() => data.value.products ?? []);
const productsRaw = computed(() => data.value ?? []);
const products = computed(() =>
productsRaw.value.map((item) => toProductListView(item))