fix: align risk frontend field names with API response
Some checks failed
CI / test (push) Failing after 4s
CI / golangci-lint (push) Failing after 4s
Security Scan / backend-security (push) Failing after 6m40s
Security Scan / frontend-security (push) Failing after 1m32s

- email -> account_name
- is_overridden -> idle_override
This commit is contained in:
win 2026-03-28 11:11:14 +08:00
parent 3333307ec1
commit cdbf05bf1c
3 changed files with 8 additions and 8 deletions

View File

@ -11,12 +11,12 @@ export interface RiskSummary {
export interface RiskAccountListItem {
account_id: number
email: string
account_name: string
platform: string
risk_level: string
risk_score: number
scored_at: string
is_overridden: boolean
idle_override: boolean
}
export interface RiskAccountList {
@ -35,12 +35,12 @@ export interface RiskBehaviorHour {
export interface RiskAccountDetail {
account_id: number
email: string
account_name: string
platform: string
risk_level: string
risk_score: number
scored_at: string
is_overridden: boolean
idle_override: boolean
override_reason: string
overridden_at: string
behavior_24h: RiskBehaviorHour[]

View File

@ -37,7 +37,7 @@
<div class="space-y-2 mb-6">
<div class="flex justify-between text-sm">
<span class="text-gray-500 dark:text-gray-400">{{ t('admin.risk.drawer.email') }}</span>
<span class="font-medium text-gray-900 dark:text-white">{{ detail.email }}</span>
<span class="font-medium text-gray-900 dark:text-white">{{ detail.account_name }}</span>
</div>
<div class="flex justify-between text-sm">
<span class="text-gray-500 dark:text-gray-400">{{ t('admin.risk.drawer.platform') }}</span>
@ -135,7 +135,7 @@ watch(
if (id != null) {
await riskStore.fetchAccountDetail(id)
detail.value = riskStore.accountDetail
overrideLevel.value = riskStore.accountDetail?.risk_level ?? 'low'
overrideLevel.value = (riskStore.accountDetail?.risk_level ?? 'low').toLowerCase()
overrideReason.value = ''
} else {
detail.value = null

View File

@ -58,8 +58,8 @@
@click="openDetail(item.account_id)"
>
<td class="px-4 py-3 text-gray-900 dark:text-white truncate max-w-[200px]">
{{ item.email }}
<span v-if="item.is_overridden" class="ml-1 text-xs text-blue-500">{{ t('admin.risk.overridden') }}</span>
{{ item.account_name }}
<span v-if="item.idle_override" class="ml-1 text-xs text-blue-500">{{ t('admin.risk.overridden') }}</span>
</td>
<td class="px-4 py-3 text-gray-600 dark:text-gray-400 capitalize">{{ item.platform }}</td>
<td class="px-4 py-3">