fix: validate signatures and restore report metrics

This commit is contained in:
hectorzhao
2026-07-27 20:51:14 +08:00
parent 04a497c791
commit 94aeacd3a2
19 changed files with 438 additions and 42 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { useState, type ReactNode } from 'react';
import { AlertTriangle, ShieldCheck, Trash2 } from 'lucide-react';
import { adminApi, clientApi, type DeletionPreflight, type DeletionResult, type DeletionTargetType } from '@/api/adminApi';
import { createUuid } from '@/utils/randomId';
import { Button } from './Button';
import { Modal } from './Modal';
import { Textarea } from './Textarea';
@@ -24,7 +25,7 @@ export function DeleteRiskAction({ portal, targetType, targetId, children = '删
const [idempotencyKey, setIdempotencyKey] = useState('');
async function begin() {
const key = `delete:${targetType}:${targetId}:${crypto.randomUUID()}`;
const key = `delete:${targetType}:${targetId}:${createUuid()}`;
setOpen(true); setLoading(true); setPreflight(null); setResult(null); setReason(''); setError(''); setIdempotencyKey(key);
try {
const data = portal === 'admin'