diff --git a/frontend/mobile-app/lib/core/services/account_service.dart b/frontend/mobile-app/lib/core/services/account_service.dart index 4f45aa02..c9bfee6b 100644 --- a/frontend/mobile-app/lib/core/services/account_service.dart +++ b/frontend/mobile-app/lib/core/services/account_service.dart @@ -33,12 +33,17 @@ class DeviceHardwareInfo { this.isPhysicalDevice, }); - /// 转换为 API 请求格式 - /// 注意: 后端只接受 model, platform, osVersion 三个字段 Map toJson() => { + if (brand != null) 'brand': brand, + if (manufacturer != null) 'manufacturer': manufacturer, if (model != null) 'model': model, - if (platform != null) 'platform': platform, + if (device != null) 'device': device, + if (product != null) 'product': product, + if (hardware != null) 'hardware': hardware, if (osVersion != null) 'osVersion': osVersion, + if (platform != null) 'platform': platform, + if (sdkInt != null) 'sdkInt': sdkInt, + if (isPhysicalDevice != null) 'isPhysicalDevice': isPhysicalDevice, }; @override