fix(kiro): 修复批量导入请求缺少认证头的问题,出现401错误

1. 在 Kiro 批量导入 token 的 fetch 请求中添加认证头
2. 使用 window.apiClient.getAuthHeaders() 获取认证信息
3. 当 apiClient 不可用时回退到默认 Content-Type 头
This commit is contained in:
leonai 2026-01-09 13:21:13 +08:00
parent f6d456cdb4
commit 76eb0f4bda

View file

@ -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 })