feat: 添加图片代理接口,保护OSS API key

This commit is contained in:
Cuishibing
2026-04-26 21:57:37 +08:00
parent f847e1c6c6
commit f1b8abf414
2 changed files with 32 additions and 1 deletions

View File

@@ -76,7 +76,7 @@ export async function POST(request: NextRequest) {
const fileData = await uploadRes.json();
const url = `${OSS_URL}/api/files/${fileData.fileKey}/preview?key=${API_KEY}`;
const url = `/api/files/${fileData.fileKey}`;
return NextResponse.json({ url, fileKey: fileData.fileKey });
} catch (error) {
console.error('Upload error:', error);