From 35c4c025793679c816de921d9c4f53c413965a85 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 27 Apr 2026 22:57:02 +0800 Subject: [PATCH] fix: simplify recharge copy --- app/api/payment/dulupay/notify/route.ts | 2 +- app/api/user/account-center/route.ts | 11 ++++++++++- components/home/lovart-home.tsx | 3 +-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/api/payment/dulupay/notify/route.ts b/app/api/payment/dulupay/notify/route.ts index bf5095d42..1035117e6 100644 --- a/app/api/payment/dulupay/notify/route.ts +++ b/app/api/payment/dulupay/notify/route.ts @@ -172,7 +172,7 @@ async function handleNotify(request: NextRequest) { userId: paidOrder.userId, amount: paidOrder.points, reason: "recharge", - note: `DuluPay 充值 (${paidOrder.outTradeNo})`, + note: "充值积分", }); } }); diff --git a/app/api/user/account-center/route.ts b/app/api/user/account-center/route.ts index d74eb5104..572ce47da 100644 --- a/app/api/user/account-center/route.ts +++ b/app/api/user/account-center/route.ts @@ -32,6 +32,15 @@ function mapLedgerReasonLabel(reason: string) { return reason || "积分变动"; } +function formatLedgerDetail(reason: string, note: string | null | undefined) { + if (reason === "recharge") { + return "充值积分"; + } + + const trimmedNote = typeof note === "string" ? note.trim() : ""; + return trimmedNote || mapLedgerReasonLabel(reason); +} + export async function GET() { try { const session = await auth(); @@ -92,7 +101,7 @@ export async function GET() { const usageRecords = ledger.map((item) => ({ id: item.id, - detail: item.note || mapLedgerReasonLabel(item.reason), + detail: formatLedgerDetail(item.reason, item.note), status: item.amount < 0 ? "consumed" : "earned", amount: item.amount, createdAt: item.createdAt?.toISOString() || new Date().toISOString(), diff --git a/components/home/lovart-home.tsx b/components/home/lovart-home.tsx index 08c6cbe1b..1e40c5cd2 100644 --- a/components/home/lovart-home.tsx +++ b/components/home/lovart-home.tsx @@ -2774,9 +2774,8 @@ export function LovartHome({ {siteSettingsData?.dulupayConfig?.enabled === true && enabledPointsPackages.length > 0 ? (
-
+

积分充值

- 支持 DuluPay 即时到账
{enabledPointsPackages.map((pkg) => {