From 76eb0f4bdad0479f0df02d7036ceba23e21d6e95 Mon Sep 17 00:00:00 2001 From: leonai <731962175@qq.com> Date: Fri, 9 Jan 2026 13:21:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(kiro):=20=E4=BF=AE=E5=A4=8D=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=AF=BC=E5=85=A5=E8=AF=B7=E6=B1=82=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=A4=B4=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=87=BA=E7=8E=B0401=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 在 Kiro 批量导入 token 的 fetch 请求中添加认证头 2. 使用 window.apiClient.getAuthHeaders() 获取认证信息 3. 当 apiClient 不可用时回退到默认 Content-Type 头 --- static/app/provider-manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/app/provider-manager.js b/static/app/provider-manager.js index 3d671c8..ce2f4eb 100644 --- a/static/app/provider-manager.js +++ b/static/app/provider-manager.js @@ -673,10 +673,10 @@ function showKiroBatchImportModal() { const details = []; try { - // 使用 fetch + SSE 获取流式响应 + // 使用 fetch + SSE 获取流式响应(需要带认证头) const response = await fetch('/api/kiro/batch-import-tokens', { method: 'POST', - headers: { + headers: window.apiClient ? window.apiClient.getAuthHeaders() : { 'Content-Type': 'application/json' }, body: JSON.stringify({ refreshTokens: tokens })