fix(kiro): 修复批量导入请求缺少认证头的问题,出现401错误
1. 在 Kiro 批量导入 token 的 fetch 请求中添加认证头 2. 使用 window.apiClient.getAuthHeaders() 获取认证信息 3. 当 apiClient 不可用时回退到默认 Content-Type 头
This commit is contained in:
parent
f6d456cdb4
commit
76eb0f4bda
1 changed files with 2 additions and 2 deletions
|
|
@ -673,10 +673,10 @@ function showKiroBatchImportModal() {
|
||||||
const details = [];
|
const details = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 使用 fetch + SSE 获取流式响应
|
// 使用 fetch + SSE 获取流式响应(需要带认证头)
|
||||||
const response = await fetch('/api/kiro/batch-import-tokens', {
|
const response = await fetch('/api/kiro/batch-import-tokens', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: window.apiClient ? window.apiClient.getAuthHeaders() : {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ refreshTokens: tokens })
|
body: JSON.stringify({ refreshTokens: tokens })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue