diff --git a/frontend/mobile-app/lib/core/services/account_service.dart b/frontend/mobile-app/lib/core/services/account_service.dart index 189cdac8..4744bbed 100644 --- a/frontend/mobile-app/lib/core/services/account_service.dart +++ b/frontend/mobile-app/lib/core/services/account_service.dart @@ -1426,20 +1426,15 @@ class AccountService { debugPrint('$_tag verifyReferralCode() - API 响应: ${response.data}'); // 检查响应数据 + // referral-service 直接返回 {"valid": true/false} 格式 final responseData = response.data as Map?; if (responseData == null) { debugPrint('$_tag verifyReferralCode() - 响应数据为 null'); throw ApiException('推荐码不存在或无效'); } - final data = responseData['data']; - if (data == null) { - debugPrint('$_tag verifyReferralCode() - data 字段为 null'); - throw ApiException('推荐码不存在或无效'); - } - - debugPrint('$_tag verifyReferralCode() - 推荐码有效'); - return data as Map; + debugPrint('$_tag verifyReferralCode() - 推荐码验证完成'); + return responseData; } on ApiException catch (e) { debugPrint('$_tag verifyReferralCode() - API 异常: $e'); rethrow;