From 7c8cea2af7562af45bb77c7a15daeb0b57c706a6 Mon Sep 17 00:00:00 2001 From: Cuishibing <643237029@qq.com> Date: Sun, 26 Apr 2026 21:39:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dmy=5Foss=20API?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=EF=BC=8C=E6=B7=BB=E5=8A=A0/api=E5=89=8D?= =?UTF-8?q?=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/upload/route.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/upload/route.ts b/app/api/upload/route.ts index 4d87468..8ada232 100644 --- a/app/api/upload/route.ts +++ b/app/api/upload/route.ts @@ -62,7 +62,7 @@ export async function POST(request: NextRequest) { const blob = new Blob([uint8Array], { type: 'image/jpeg' }); formData2.append('file', blob, 'image.jpg'); - const uploadRes = await fetch(`${OSS_URL}/files`, { + const uploadRes = await fetch(`${OSS_URL}/api/files`, { method: 'POST', headers: { 'x-api-key': API_KEY, @@ -79,7 +79,7 @@ export async function POST(request: NextRequest) { const fileData = await uploadRes.json(); // 返回 my_oss 的访问URL - const url = `${OSS_URL}/files/${fileData.fileKey}/preview`; + const url = `${OSS_URL}/api/files/${fileData.fileKey}/preview`; return NextResponse.json({ url, fileKey: fileData.fileKey }); } catch (error) { console.error('Upload error:', error); @@ -96,7 +96,7 @@ export async function DELETE(request: NextRequest) { return NextResponse.json({ error: '缺少文件标识' }, { status: 400 }); } - const res = await fetch(`${OSS_URL}/files/${fileKey}`, { + const res = await fetch(`${OSS_URL}/api/files/${fileKey}`, { method: 'DELETE', headers: { 'x-api-key': API_KEY,