fix(mobile-app): always fetch deposit address from server in deposit_service

Remove local storage cache priority to avoid returning wrong address
after account switching. Always fetch from server API to ensure the
address belongs to the currently logged-in user.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-04 10:17:41 -08:00
parent 04545c86a5
commit 99b2b10ba0
1 changed files with 4 additions and 20 deletions

View File

@ -90,31 +90,15 @@ class DepositService {
///
///
///
///
/// 使
/// KAVA BSC
Future<DepositAddressResponse> getDepositAddresses() async {
try {
debugPrint('获取充值地址...');
//
final kavaAddress = await _secureStorage.read(key: StorageKeys.walletAddressKava);
final bscAddress = await _secureStorage.read(key: StorageKeys.walletAddressBsc);
final dstAddress = await _secureStorage.read(key: StorageKeys.walletAddressDst);
if (kavaAddress != null && kavaAddress.isNotEmpty &&
bscAddress != null && bscAddress.isNotEmpty &&
dstAddress != null && dstAddress.isNotEmpty) {
debugPrint('从本地存储获取充值地址: kava=$kavaAddress, bsc=$bscAddress, dst=$dstAddress');
return DepositAddressResponse(
kavaAddress: kavaAddress,
bscAddress: bscAddress,
dstAddress: dstAddress,
isValid: true,
);
}
//
debugPrint('本地无缓存,从服务器获取钱包地址...');
//
debugPrint('从服务器获取钱包地址...');
final response = await _apiClient.get('/user/wallet');
if (response.statusCode == 200) {