From f98f7b2d393728a680048eaa35ebf72b2bcb8ba5 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 21 Dec 2025 17:13:18 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E7=A0=81=E9=AA=8C=E8=AF=81API=E5=93=8D=E5=BA=94=E8=A7=A3?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - referral-service返回 {valid:bool} 格式 - 移除对 data 字段的依赖 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../mobile-app/lib/core/services/account_service.dart | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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;