Fix: 调整Strapi类型
This commit is contained in:
@ -97,7 +97,6 @@ onMounted(async () => {
|
|||||||
populate: '*',
|
populate: '*',
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const item = response.data
|
const item = response.data
|
||||||
production.value = {
|
production.value = {
|
||||||
@ -108,7 +107,7 @@ onMounted(async () => {
|
|||||||
production_specs: item.production_specs,
|
production_specs: item.production_specs,
|
||||||
production_image: item.production_image,
|
production_image: item.production_image,
|
||||||
documentId: item.documentId,
|
documentId: item.documentId,
|
||||||
}
|
documents: item.documents || [] }
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to fetch production:', error)
|
console.error('Failed to fetch production:', error)
|
||||||
|
|||||||
@ -7,18 +7,13 @@ export interface StrapiEntity {
|
|||||||
locale?: string;
|
locale?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StrapiImage {
|
export interface StrapiMedia {
|
||||||
id: number;
|
id: number;
|
||||||
url: string;
|
url: string;
|
||||||
|
ext?: string;
|
||||||
|
name?: string;
|
||||||
alternativeText?: string;
|
alternativeText?: string;
|
||||||
caption?: string;
|
caption?: string;
|
||||||
width?: number;
|
|
||||||
height?: number;
|
|
||||||
formats?: {
|
|
||||||
small?: StrapiImageFormat;
|
|
||||||
medium?: StrapiImageFormat;
|
|
||||||
thumbnail?: StrapiImageFormat;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StrapiImageFormat {
|
export interface StrapiImageFormat {
|
||||||
@ -28,6 +23,16 @@ export interface StrapiImageFormat {
|
|||||||
size: number;
|
size: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StrapiImage extends StrapiMedia {
|
||||||
|
width?: number;
|
||||||
|
height?: number;
|
||||||
|
formats?: {
|
||||||
|
small?: StrapiImageFormat;
|
||||||
|
medium?: StrapiImageFormat;
|
||||||
|
thumbnail?: StrapiImageFormat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface StrapiResponse<T> {
|
export interface StrapiResponse<T> {
|
||||||
data: T;
|
data: T;
|
||||||
meta?: {
|
meta?: {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { StrapiEntity, StrapiImage } from './common';
|
import type { StrapiEntity, StrapiImage, StrapiMedia } from './common';
|
||||||
|
|
||||||
export interface ProductionType extends StrapiEntity {
|
export interface ProductionType extends StrapiEntity {
|
||||||
type: string;
|
type: string;
|
||||||
@ -11,4 +11,5 @@ export interface Production extends StrapiEntity {
|
|||||||
production_image?: StrapiImage;
|
production_image?: StrapiImage;
|
||||||
production_details?: string;
|
production_details?: string;
|
||||||
production_specs?: string | object;
|
production_specs?: string | object;
|
||||||
|
documents?: StrapiMedia[];
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user