fix: repair admin page api contracts

This commit is contained in:
2026-09-10 21:31:38 +08:00
parent 7994e081a6
commit d6f5f25c35
30 changed files with 286 additions and 110 deletions
@@ -125,7 +125,7 @@ async function loadData() {
try {
const token = localStorage.getItem('accessToken')
const res: any = await get(`/operator/risk/reports/${statusFilter.value}`, {}, { Authorization: `Bearer ${token}` })
tableData.value = res || []
tableData.value = res.data || []
loadStats()
} catch (e) { console.error(e) }
finally { loading.value = false }
@@ -135,11 +135,12 @@ async function loadStats() {
try {
const token = localStorage.getItem('accessToken')
const res: any = await get('/operator/risk/reports/stats', {}, { Authorization: `Bearer ${token}` })
const data = res.data || {}
stats.value = [
{ key: 'pending', label: '待处理', value: res.pendingCount || 0, color: '#E96B6B' },
{ key: 'processing', label: '处理中', value: res.processingCount || 0, color: '#E59A32' },
{ key: 'resolved', label: '已处理', value: res.resolvedCount || 0, color: '#67C23A' },
{ key: 'dismissed', label: '已驳回', value: res.dismissedCount || 0, color: '#909399' }
{ key: 'pending', label: '待处理', value: data.pendingCount || 0, color: '#E96B6B' },
{ key: 'processing', label: '处理中', value: data.processingCount || 0, color: '#E59A32' },
{ key: 'resolved', label: '已处理', value: data.resolvedCount || 0, color: '#67C23A' },
{ key: 'dismissed', label: '已驳回', value: data.dismissedCount || 0, color: '#909399' }
]
} catch {}
}
@@ -152,7 +153,7 @@ async function openDetail(reportId: string) {
try {
const token = localStorage.getItem('accessToken')
const res: any = await get(`/operator/risk/reports/${reportId}`, {}, { Authorization: `Bearer ${token}` })
detail.value = res
detail.value = res.data
} catch (e) { console.error(e) }
}