为 audioplayers_android 模块单独设置 Java 1.8,其他模块保持 Java 17
This commit is contained in:
@@ -337,10 +337,8 @@ class _PopularPageState extends State<PopularPage>
|
||||
final isPreloadEnabled = await LocalCacheManager().isPreloadEnabled();
|
||||
|
||||
if (isPreloadEnabled && !forceRefresh) {
|
||||
print('预加载模式:尝试从本地缓存加载数据');
|
||||
final cachedData = await LocalCacheManager().getCachedPopularList(type);
|
||||
if (cachedData != null && cachedData.isNotEmpty) {
|
||||
print('从本地缓存加载数据成功');
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_rankList = cachedData
|
||||
@@ -351,29 +349,19 @@ class _PopularPageState extends State<PopularPage>
|
||||
}
|
||||
return;
|
||||
}
|
||||
print('本地缓存为空,从服务器加载');
|
||||
}
|
||||
|
||||
print('正在请求排行榜数据: type=$type, period=$type');
|
||||
|
||||
final response = await HttpClient.get(
|
||||
'/rlist.php',
|
||||
queryParameters: {'type': type, 'limit': '20'},
|
||||
);
|
||||
|
||||
print('API响应状态: ${response.statusCode}');
|
||||
print('API响应成功: ${response.isSuccess}');
|
||||
print('API响应代码: ${response.code}');
|
||||
print('API响应消息: ${response.message}');
|
||||
print('API响应数据: ${response.data}');
|
||||
|
||||
if (response.isSuccess && response.code == 0) {
|
||||
final data = response.data;
|
||||
final rankData = data['list'] as List<dynamic>? ?? [];
|
||||
final rankDataList = rankData.cast<Map<String, dynamic>>();
|
||||
|
||||
if (isPreloadEnabled) {
|
||||
print('保存数据到本地缓存');
|
||||
await LocalCacheManager().cachePopularList(type, rankDataList);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user