diff --git a/app/admin/page.tsx b/app/admin/page.tsx index d6b0c4b4..172adb51 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -63,7 +63,7 @@ export default function AdminDashboard() { ) } - const totalRevenue = purchases.reduce((sum, p) => sum + (p.amount || 0), 0) + const totalRevenue = purchases.reduce((sum, p) => sum + Number(p.amount || 0), 0) const totalUsers = users.length const totalPurchases = purchases.length @@ -71,7 +71,7 @@ export default function AdminDashboard() { { title: "总用户数", value: totalUsers, icon: Users, color: "text-blue-400", bg: "bg-blue-500/20", link: "/admin/users" }, { title: "总收入", - value: `¥${totalRevenue.toFixed(2)}`, + value: `¥${Number(totalRevenue).toFixed(2)}`, icon: TrendingUp, color: "text-[#38bdac]", bg: "bg-[#38bdac]/20",