diff --git a/app/api/evaluation_points/rule-groups.ts b/app/api/evaluation_points/rule-groups.ts index b243be9..19e02f3 100644 --- a/app/api/evaluation_points/rule-groups.ts +++ b/app/api/evaluation_points/rule-groups.ts @@ -1201,7 +1201,7 @@ export async function getEvaluationPointGroups( const response = await apiRequest(url, { method: 'GET', - headers: token ? { 'Authorization': `Bearer ${token}` } : {} + ...(token ? { headers: { 'Authorization': `Bearer ${token}` } } : {}) }); // 🔍 调试:打印完整响应 @@ -1260,7 +1260,7 @@ export async function getAllEvaluationPointGroups( const response = await apiRequest(url, { method: 'GET', - headers: token ? { 'Authorization': `Bearer ${token}` } : {} + ...(token ? { headers: { 'Authorization': `Bearer ${token}` } } : {}) }); if (response.error) { @@ -1302,7 +1302,7 @@ export async function getEvaluationPointGroup( const response = await apiRequest(url, { method: 'GET', - headers: token ? { 'Authorization': `Bearer ${token}` } : {} + ...(token ? { headers: { 'Authorization': `Bearer ${token}` } } : {}) }); if (response.error) { @@ -1352,7 +1352,7 @@ export async function getEvaluationPointGroupChildren( const response = await apiRequest(url, { method: 'GET', - headers: token ? { 'Authorization': `Bearer ${token}` } : {} + ...(token ? { headers: { 'Authorization': `Bearer ${token}` } } : {}) }); if (response.error) { @@ -1511,7 +1511,7 @@ export async function deleteEvaluationPointGroup( `/api/v3/evaluation-point-groups/${id}`, { method: 'DELETE', - headers: token ? { 'Authorization': `Bearer ${token}` } : {} + ...(token ? { headers: { 'Authorization': `Bearer ${token}` } } : {}) } );