diff --git a/lib/http/search.dart b/lib/http/search.dart index 49b784e3..d547fc33 100644 --- a/lib/http/search.dart +++ b/lib/http/search.dart @@ -97,7 +97,10 @@ class SearchHttp { if (pubEnd != null) 'pubtime_end_s': pubEnd, }; var res = await Request().get(Api.searchByType, queryParameters: reqData); - if (res.data['code'] is int && res.data['code'] == 0) { + if (res.data is! Map) { + return LoadingState.error('没有相关数据'); + } + if (res.data['code'] == 0) { dynamic data; try { switch (searchType) { diff --git a/lib/http/video.dart b/lib/http/video.dart index c54c01fc..1487e88b 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -245,7 +245,7 @@ class VideoHttp { 'web_location': 1550101, }); - final usePgcApi = forcePgcApi == true || GStorage.isLogin; + late final usePgcApi = forcePgcApi == true || GStorage.isLogin; try { var res = await Request().get(