Fix:修正前后端Bug
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
<div class="production-header">
|
||||
<div class="production-image">
|
||||
<el-image
|
||||
:src="useStrapiMedia(production?.production_image?.url || '')" :alt="production.title"
|
||||
:src="useStrapiMedia(production?.cover?.url || '')" :alt="production.title"
|
||||
fit="contain" />
|
||||
</div>
|
||||
<div class="production-info">
|
||||
@ -84,7 +84,10 @@ onMounted(async () => {
|
||||
production_specs: {
|
||||
populate: '*',
|
||||
},
|
||||
production_image: {
|
||||
production_images: {
|
||||
populate: '*',
|
||||
},
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
},
|
||||
|
||||
@ -20,7 +20,7 @@ v-for="(group, type) in groupedProductions" :key="type" :title="type || '未分
|
||||
<production-card
|
||||
v-for="production in group" :key="production.documentId || production.id"
|
||||
:slug="production.documentId"
|
||||
:image-url="useStrapiMedia(production?.production_image?.url || '')"
|
||||
:image-url="useStrapiMedia(production?.cover?.url || '')"
|
||||
:name="production.title" :description="production.summary || ''" />
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
@ -62,7 +62,10 @@ onMounted(async () => {
|
||||
try {
|
||||
const response = await find<Production>('productions', {
|
||||
populate: {
|
||||
production_image: {
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
production_images: {
|
||||
populate: '*',
|
||||
},
|
||||
production_type: {
|
||||
@ -76,6 +79,7 @@ onMounted(async () => {
|
||||
},
|
||||
locale: strapiLocale,
|
||||
})
|
||||
console.log('Fetched productions:', response.data)
|
||||
productions.value = response.data.map((item: Production) => ({
|
||||
...item,
|
||||
// 保持 production_type 原始类型,兼容对象或字符串
|
||||
|
||||
Reference in New Issue
Block a user