diff --git a/api/common.ts b/api/common.ts index 4c2e4d5..35084f1 100644 --- a/api/common.ts +++ b/api/common.ts @@ -3,7 +3,7 @@ import { BASE_URL } from './constants' export interface ApiResponse { code: number - successful: boolean + successfull: boolean message: string data: T } diff --git a/api/resources.ts b/api/resources.ts index a881f9c..ff05796 100644 --- a/api/resources.ts +++ b/api/resources.ts @@ -1,5 +1,5 @@ -import { post } from './request'; import { ApiResponse } from './common'; +import { post } from './request'; // 资源列表请求参数 export interface ResourcesListRequest { @@ -16,8 +16,9 @@ export interface Resource { script_id: number; created_at: string; } + -// 获取资源列表 +// 获取资源列表 - 按创建者筛选 export const getResourcesList = async (data: ResourcesListRequest): Promise> => { - return post>('/api/resources/resources/list', data); + return post>('https://movieflow.api.huiying.video/resources/list', data); }; \ No newline at end of file diff --git a/components/pages/home-page2.tsx b/components/pages/home-page2.tsx index ec14bad..f199b7d 100644 --- a/components/pages/home-page2.tsx +++ b/components/pages/home-page2.tsx @@ -42,7 +42,8 @@ export function HomePage2() { try { setIsLoadingResources(true); const response = await getResourcesList({ published: 1 }); - if (response.code === 0 && response.successful) { + console.log(response); + if (response.code === 0 && response.successfull) { setResources(response.data); } else { console.error('获取资源列表失败:', response.message);