修复控制台最近调用显示失败的问题:isSuccess 将 LogTypeConsume(2) 和 LogTypeTopup(1) 也识别为成功

This commit is contained in:
wangxiaoji 2026-06-30 09:30:34 +08:00
parent b14a09af73
commit 6a99f229e3
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ import { ArrowUpRight, Clock, Inbox } from 'lucide-react';
import { renderQuota, renderNumber, timestamp2string } from '../../helpers'; import { renderQuota, renderNumber, timestamp2string } from '../../helpers';
const isSuccess = (l) => const isSuccess = (l) =>
l?.type === 0 || l?.status === 0 || l?.type === 'success' || l?.type === undefined; l?.type === 0 || l?.type === 1 || l?.type === 2 || l?.status === 0 || l?.type === 'success' || l?.type === undefined;
const RecentActivity = ({ logs = [], className = '' }) => { const RecentActivity = ({ logs = [], className = '' }) => {
const recent = useMemo(() => logs.slice(0, 10), [logs]); const recent = useMemo(() => logs.slice(0, 10), [logs]);

View File

@ -23,7 +23,7 @@ import { API, isAdmin, showError } from '../../helpers';
const PAGE_SIZE = 200; const PAGE_SIZE = 200;
const isSuccess = (l) => const isSuccess = (l) =>
l?.type === 0 || l?.status === 0 || l?.type === 'success'; l?.type === 0 || l?.type === 1 || l?.type === 2 || l?.status === 0 || l?.type === 'success';
const sum = (arr, key) => const sum = (arr, key) =>
arr.reduce((s, l) => s + (Number(l[key]) || 0), 0); arr.reduce((s, l) => s + (Number(l[key]) || 0), 0);