diff --git a/apps/web/src/api/points/index.ts b/apps/web/src/api/points/index.ts index e1a49e44c..1ed8535d8 100644 --- a/apps/web/src/api/points/index.ts +++ b/apps/web/src/api/points/index.ts @@ -236,16 +236,16 @@ function genMockTransactions(): PointsTransactionsResponse { // Rebuild balance_after going forward let running = 50 + 0 // after registration gift for (let i = items.length - 1; i >= 0; i--) { - const it: any = items[i] + const it = items[i] if (it.source === "task_reward" && it.description.includes("注册")) running = 50 } running = 50 const fwd = [...items].reverse() - for (const it of fwd as any[]) { + for (const it of fwd) { running += it.signed_amount it.balance_after = running } - return { items: fwd as any, total: fwd.length, page: 1, page_size: 20 } + return { items: fwd, total: fwd.length, page: 1, page_size: 20 } } // ==================== 真实 API ==================== @@ -285,7 +285,7 @@ export async function createPointsOrder(req: PointsRechargeRequest): Promise p.id === req.package_id) const mt = MOCK_PACKAGES.user_member_type const discountKey = `discounted_price_for_${mt}` as const - const price = (pkg as any)?.[discountKey] ?? pkg?.price ?? 0 + const price = (pkg as PointsPackage & Record)?.[discountKey] ?? pkg?.price ?? 0 return new Promise((r) => setTimeout( () =>