fix: 修复RMBG API密钥请求头格式 - 使用X-API-Key而不是Authorization Bearer
This commit is contained in:
parent
2b573e20b4
commit
997afdd694
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user