From 4a1bf3aafe38c3928efb5e3d50fbdb4be123a32d Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 26 Feb 2026 08:36:38 -0800 Subject: [PATCH] =?UTF-8?q?fix(trading):=20=E4=BF=AE=E5=A4=8D=E5=B7=B2?= =?UTF-8?q?=E5=88=86=E9=85=8D=E7=A7=AF=E5=88=86=E8=82=A1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=BA0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mining-service 返回格式为 { success: true, data: { totalDistributed: "..." } } 但 getTotalMinedFromMiningService() 直接取 result.totalDistributed, 应该取 result.data.totalDistributed。 同时兼容两种格式,优先取 result.data.totalDistributed。 Co-Authored-By: Claude Opus 4.6 --- .../src/application/services/asset.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/services/trading-service/src/application/services/asset.service.ts b/backend/services/trading-service/src/application/services/asset.service.ts index b8abb536..fb17ae4b 100644 --- a/backend/services/trading-service/src/application/services/asset.service.ts +++ b/backend/services/trading-service/src/application/services/asset.service.ts @@ -243,8 +243,10 @@ export class AssetService { const result = await response.json(); // totalDistributed = 用户已挖总量 + 系统已挖总量 - if (result?.totalDistributed) { - return new Money(result.totalDistributed); + // mining-service 返回格式: { success: true, data: { totalDistributed: "..." } } + const totalDistributed = result?.data?.totalDistributed || result?.totalDistributed; + if (totalDistributed) { + return new Money(totalDistributed); } return Money.zero(); } catch (error) {