From 8795b4d0456662c1bd749f3b49885ae98cf5bf06 Mon Sep 17 00:00:00 2001 From: WangDL Date: Sun, 24 May 2026 18:02:57 +0800 Subject: [PATCH] fix: use correct token key for CSV download auth Co-Authored-By: Claude Opus 4.7 --- src/pages/ReportingAdmin.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ReportingAdmin.tsx b/src/pages/ReportingAdmin.tsx index ab2574d..0840895 100644 --- a/src/pages/ReportingAdmin.tsx +++ b/src/pages/ReportingAdmin.tsx @@ -2,6 +2,7 @@ import { Card, Button, Space, Typography, Table, message, Select } from 'antd' import { DownloadOutlined } from '@ant-design/icons' import { useQuery } from '@tanstack/react-query' import { api } from '@/services/http-client' +import { getAccessToken } from '@/services/token-store' import { useState } from 'react' const { Title } = Typography @@ -25,7 +26,7 @@ export default function ReportingAdmin() { const download = async (type: string) => { try { const res = await fetch(`/admin-api/reporting/export/${type}?days=${days}`, { - headers: { Authorization: `Bearer ${localStorage.getItem('accessToken') || ''}` }, + headers: { Authorization: `Bearer ${getAccessToken() || ''}` }, }) if (!res.ok) throw new Error('下载失败') const text = await res.text()