fix(account): 修复 verifyLoginPassword/verifyPaymentPassword 未读取 TransformInterceptor 包装层的 bug

后端 TransformInterceptor 将所有响应包装为 { success, data: <实际数据> },
但两个 verify 方法直接读 response.data['valid'],导致始终得到 null == true → false,
用户输入正确密码也显示"密码错误"。修复为读取 response.data['data']['valid']。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-05 08:47:17 -08:00
parent 405e7e407e
commit 5df9c97794
1 changed files with 4 additions and 4 deletions

View File

@ -2109,7 +2109,7 @@ class AccountService {
///
/// [password]
///
/// { "valid": true/false }
/// TransformInterceptor { "success": true, "data": { "valid": true/false } }
/// - true
/// - falsevalid=false
/// - /ApiException
@ -2120,7 +2120,7 @@ class AccountService {
'/user/verify-password',
data: {'password': password},
);
final valid = response.data['valid'] == true;
final valid = response.data['data']['valid'] == true;
debugPrint('$_tag verifyLoginPassword() - 验证结果: $valid');
return valid;
} on ApiException catch (e) {
@ -2196,7 +2196,7 @@ class AccountService {
/// (POST /user/verify-payment-password)
///
/// { "valid": true/false }
/// TransformInterceptor { "success": true, "data": { "valid": true/false } }
/// - true
/// - false
/// -
@ -2207,7 +2207,7 @@ class AccountService {
'/user/verify-payment-password',
data: {'password': password},
);
final valid = response.data['valid'] == true;
final valid = response.data['data']['valid'] == true;
debugPrint('$_tag verifyPaymentPassword() - 验证结果: $valid');
return valid;
} on ApiException catch (e) {