fix(mobile-app): fix API response parsing for auto-create and wallet
- Extract 'data' field from API response before parsing - Fix createAccount() to parse responseData['data'] - Fix getWalletInfo() to parse responseData['data'] - Resolves: type 'Null' is not a subtype of type 'int' in type cast 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
8e9eb0ef19
commit
72c49ffe7a
|
|
@ -301,9 +301,9 @@ class AccountService {
|
|||
}
|
||||
|
||||
debugPrint('$_tag createAccount() - 解析响应数据');
|
||||
final result = CreateAccountResponse.fromJson(
|
||||
response.data as Map<String, dynamic>,
|
||||
);
|
||||
final responseData = response.data as Map<String, dynamic>;
|
||||
final data = responseData['data'] as Map<String, dynamic>;
|
||||
final result = CreateAccountResponse.fromJson(data);
|
||||
debugPrint('$_tag createAccount() - 解析成功: $result');
|
||||
|
||||
// 保存账号数据到安全存储
|
||||
|
|
@ -341,9 +341,9 @@ class AccountService {
|
|||
}
|
||||
|
||||
debugPrint('$_tag getWalletInfo() - 解析响应数据');
|
||||
final result = WalletInfoResponse.fromJson(
|
||||
response.data as Map<String, dynamic>,
|
||||
);
|
||||
final responseData = response.data as Map<String, dynamic>;
|
||||
final data = responseData['data'] as Map<String, dynamic>;
|
||||
final result = WalletInfoResponse.fromJson(data);
|
||||
debugPrint('$_tag getWalletInfo() - 解析成功: $result');
|
||||
|
||||
// 如果钱包已就绪,保存钱包地址和助记词
|
||||
|
|
|
|||
Loading…
Reference in New Issue