fix(trading): 修复已分配积分股显示为0的问题
mining-service 返回格式为 { success: true, data: { totalDistributed: "..." } }
但 getTotalMinedFromMiningService() 直接取 result.totalDistributed,
应该取 result.data.totalDistributed。
同时兼容两种格式,优先取 result.data.totalDistributed。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
acf55b26a7
commit
4a1bf3aafe
|
|
@ -243,8 +243,10 @@ export class AssetService {
|
||||||
|
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
// totalDistributed = 用户已挖总量 + 系统已挖总量
|
// totalDistributed = 用户已挖总量 + 系统已挖总量
|
||||||
if (result?.totalDistributed) {
|
// mining-service 返回格式: { success: true, data: { totalDistributed: "..." } }
|
||||||
return new Money(result.totalDistributed);
|
const totalDistributed = result?.data?.totalDistributed || result?.totalDistributed;
|
||||||
|
if (totalDistributed) {
|
||||||
|
return new Money(totalDistributed);
|
||||||
}
|
}
|
||||||
return Money.zero();
|
return Money.zero();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue