fix(pre-planting): 修复 settleAfterPrePlanting 响应解包(TransformInterceptor)

wallet-service 的 TransformInterceptor 会将响应包装为 { data: {...} },
需要从 response.data.data 中提取实际数据,与 allocatePrePlantingFunds 一致。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-01 08:57:45 -08:00
parent 722c124cc9
commit 718e70e61a
1 changed files with 5 additions and 7 deletions

View File

@ -424,17 +424,15 @@ export class WalletServiceClient {
`settleAfterPrePlanting(${accountSequence})`,
async () => {
const response = await firstValueFrom(
this.httpService.post<{
markedAsPlanted: boolean;
settledCount: number;
totalUsdt: number;
totalHashpower: number;
}>(
this.httpService.post(
`${this.baseUrl}/api/v1/wallets/settle-after-pre-planting`,
{ accountSequence },
),
);
return response.data;
// wallet-service 使用 TransformInterceptor响应格式为
// { success: true, data: { markedAsPlanted, settledCount, ... }, timestamp: "..." }
const data = response.data?.data ?? response.data;
return data;
},
);
} catch (error) {