diff --git a/frontend/mobile-app/lib/core/services/account_service.dart b/frontend/mobile-app/lib/core/services/account_service.dart index 00f67a3a..02b346d6 100644 --- a/frontend/mobile-app/lib/core/services/account_service.dart +++ b/frontend/mobile-app/lib/core/services/account_service.dart @@ -2101,18 +2101,19 @@ class AccountService { Future verifyLoginPassword(String password) async { debugPrint('$_tag verifyLoginPassword() - 开始验证登录密码'); try { - await _apiClient.post( + final response = await _apiClient.post( '/user/verify-password', data: {'password': password}, ); - debugPrint('$_tag verifyLoginPassword() - 密码验证成功'); - return true; + final valid = response.data['valid'] == true; + debugPrint('$_tag verifyLoginPassword() - 验证结果: $valid'); + return valid; } on ApiException catch (e) { - debugPrint('$_tag verifyLoginPassword() - 密码错误: $e'); - return false; - } catch (e) { debugPrint('$_tag verifyLoginPassword() - 验证异常: $e'); rethrow; + } catch (e) { + debugPrint('$_tag verifyLoginPassword() - 未知异常: $e'); + rethrow; } }