From 997afdd69400fa4ed17197e999f7cbea2f52bb12 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 29 Dec 2025 00:08:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DRMBG=20API=E5=AF=86?= =?UTF-8?q?=E9=92=A5=E8=AF=B7=E6=B1=82=E5=A4=B4=E6=A0=BC=E5=BC=8F=20-=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8X-API-Key=E8=80=8C=E4=B8=8D=E6=98=AFAuthoriza?= =?UTF-8?q?tion=20Bearer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/rmbg/route.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/api/rmbg/route.ts b/app/api/rmbg/route.ts index 588fb81..5d5669c 100644 --- a/app/api/rmbg/route.ts +++ b/app/api/rmbg/route.ts @@ -181,11 +181,9 @@ export async function POST(request: NextRequest) { "Content-Type": "application/json", }; - // 如果配置了API Key,添加到请求头 + // 如果配置了API Key,添加到请求头(根据RMBG API文档要求使用X-API-Key) if (config.apiKey) { - headers["Authorization"] = `Bearer ${config.apiKey}`; - // 或者根据API文档要求添加,例如: - // headers["X-API-Key"] = config.apiKey; + headers["X-API-Key"] = config.apiKey; } const startTime = Date.now();