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