为 audioplayers_android 模块单独设置 Java 1.8,其他模块保持 Java 17

This commit is contained in:
Developer
2026-03-31 03:13:47 +08:00
parent 7c09ade2bb
commit d66dc73349
24 changed files with 367 additions and 527 deletions

View File

@@ -34,32 +34,19 @@ class VoteApi {
static final Dio _dio = Dio(_options)
..interceptors.add(CookieManager(_cookieJar));
static void _debugLog(String message) {
if (kDebugMode) {
print('VoteApi: $message');
}
}
static Future<Map<String, dynamic>> _get(
String path, {
Map<String, dynamic>? queryParameters,
}) async {
try {
final url = '$_baseUrl$path';
_debugLog('GET $url');
if (queryParameters != null) {
_debugLog('查询参数: $queryParameters');
}
final response = await _dio.get(url, queryParameters: queryParameters);
_debugLog('响应: ${response.data}');
return response.data as Map<String, dynamic>;
} on DioException catch (e) {
_debugLog('Dio异常: ${e.type} - ${e.message}');
throw Exception('请求失败: ${e.message}');
} catch (e) {
_debugLog('未知异常: $e');
throw Exception('请求失败: $e');
}
}
@@ -70,20 +57,13 @@ class VoteApi {
}) async {
try {
final url = '$_baseUrl$path';
_debugLog('POST $url');
if (data != null) {
_debugLog('请求数据: $data');
}
final response = await _dio.post(url, data: data);
_debugLog('响应: ${response.data}');
return response.data as Map<String, dynamic>;
} on DioException catch (e) {
_debugLog('Dio异常: ${e.type} - ${e.message}');
throw Exception('请求失败: ${e.message}');
} catch (e) {
_debugLog('未知异常: $e');
throw Exception('请求失败: $e');
}
}