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:
parent
722c124cc9
commit
718e70e61a
|
|
@ -424,17 +424,15 @@ export class WalletServiceClient {
|
||||||
`settleAfterPrePlanting(${accountSequence})`,
|
`settleAfterPrePlanting(${accountSequence})`,
|
||||||
async () => {
|
async () => {
|
||||||
const response = await firstValueFrom(
|
const response = await firstValueFrom(
|
||||||
this.httpService.post<{
|
this.httpService.post(
|
||||||
markedAsPlanted: boolean;
|
|
||||||
settledCount: number;
|
|
||||||
totalUsdt: number;
|
|
||||||
totalHashpower: number;
|
|
||||||
}>(
|
|
||||||
`${this.baseUrl}/api/v1/wallets/settle-after-pre-planting`,
|
`${this.baseUrl}/api/v1/wallets/settle-after-pre-planting`,
|
||||||
{ accountSequence },
|
{ accountSequence },
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return response.data;
|
// wallet-service 使用 TransformInterceptor,响应格式为
|
||||||
|
// { success: true, data: { markedAsPlanted, settledCount, ... }, timestamp: "..." }
|
||||||
|
const data = response.data?.data ?? response.data;
|
||||||
|
return data;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue