Merge branch 'main' of gitee.com:wg123/video-gen

This commit is contained in:
Lrd
2026-07-03 18:11:44 +08:00
14 changed files with 636 additions and 190 deletions
+14
View File
@@ -113,6 +113,20 @@ export async function optimizePrompt(
image_px: params.image_px || null,
});
}
export async function uploadAudio(file: File): Promise<{ url: string; filename: string }> {
const form = new FormData();
form.append('file', file);
const token = localStorage.getItem('auth_token');
const res = await fetch(`${import.meta.env.VITE_API_BASE || 'http://localhost:8000'}/api/generation-records/upload-audio`, {
method: 'POST',
headers: token ? { Authorization: `Bearer ${token}` } : {},
body: form,
});
if (!res.ok) throw new Error('图片上传失败');
const data = await res.json();
return { url: data.url, filename: data.filename };
}
export async function uploadImage(file: File): Promise<{ url: string; filename: string }> {
const form = new FormData();
form.append('file', file);