diff --git a/frontend/mobile-app/lib/core/network/api_client.dart b/frontend/mobile-app/lib/core/network/api_client.dart index 939dc3ed..6eb1305d 100644 --- a/frontend/mobile-app/lib/core/network/api_client.dart +++ b/frontend/mobile-app/lib/core/network/api_client.dart @@ -384,7 +384,10 @@ class ApiClient { case DioExceptionType.badResponse: final statusCode = error.response?.statusCode; final data = error.response?.data; - final message = data is Map ? data['message'] ?? '请求失败' : '请求失败'; + final rawMsg = data is Map ? data['message'] : null; + final message = rawMsg is List + ? (rawMsg as List).join(', ') + : (rawMsg?.toString() ?? '请求失败'); switch (statusCode) { case 400: diff --git a/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart b/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart index b507f02d..d0eb3215 100644 --- a/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart +++ b/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart @@ -351,10 +351,10 @@ class _PrePlantingPurchasePageState final response = await prePlantingService.createOrder( portionCount: _quantity, // 首次购买时传省市信息,续购时后端自动复用 - provinceCode: _isFirstPurchase ? _selectedProvinceCode : null, - provinceName: _isFirstPurchase ? _selectedProvinceName : null, - cityCode: _isFirstPurchase ? _selectedCityCode : null, - cityName: _isFirstPurchase ? _selectedCityName : null, + provinceCode: _isFirstPurchase ? _selectedProvinceCode : _position?.provinceCode, + provinceName: _isFirstPurchase ? _selectedProvinceName : _position?.provinceName, + cityCode: _isFirstPurchase ? _selectedCityCode : _position?.cityCode, + cityName: _isFirstPurchase ? _selectedCityName : _position?.cityName, ); debugPrint(