基本完成除了详情

This commit is contained in:
zhutao
2025-09-04 10:16:11 +08:00
commit 4d12f8afc2
110 changed files with 4729 additions and 0 deletions

14
lib/api/network/safe.dart Normal file
View File

@@ -0,0 +1,14 @@
import 'package:dio/dio.dart';
/// 网络请求的错误处理封装
Future<T> safeRequest<T>(
Future<T> request, {
void Function(DioException error)? onError,
}) async {
try {
return await request;
} on DioException catch (e) {
onError?.call(e); // 额外 hook
rethrow; // 继续往上传
}
}