修复审计导出错误解析并接入密码确认重试
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-08 19:05:58 +08:00
1 parent d941074095
commit 9855a20906
5 files changed
+156 -2

No files matched your search

@@ -727,7 +727,9 @@ export function usePage(pageKey = 'base') {
if (!canExportAudit.value || working.value) return
working.value = format === 'csv' ? 'export-csv' : 'export'
try {
const response = await http.post('/api/v1/audits/config', { format, limit: 500 }, { responseType: 'blob' })
const response = await requestWithRecentAuthentication(() => http.post(
'/api/v1/audits/config', { format, limit: 500 }, { responseType: 'blob' }
))
if (!(response instanceof Blob)) {
throw new Error(response?.errorMsg || '审计导出响应格式不正确')
}
@@ -747,7 +749,7 @@ export function usePage(pageKey = 'base') {
URL.revokeObjectURL(url)
ElMessage.success('审计记录已导出')
} catch (error) {
ElMessage.error(error.message || '审计导出失败')
if (!isRecentAuthenticationCancelled(error)) ElMessage.error(error.message || '审计导出失败')
} finally {
working.value = ''
}