fix: 历史记录相关错误

This commit is contained in:
guozhigq
2024-03-20 23:21:41 +08:00
parent 734db176bf
commit 710361caea
2 changed files with 12 additions and 6 deletions

View File

@ -45,10 +45,14 @@ class ApiInterceptor extends Interceptor {
void onError(DioException err, ErrorInterceptorHandler handler) async {
// 处理网络请求错误
// handler.next(err);
String url = err.requestOptions.uri.toString();
print('🌹🌹ApiInterceptor: $url');
if (!url.contains('heartBeat')) {
SmartDialog.showToast(
await dioError(err),
displayType: SmartToastType.onlyRefresh,
);
}
super.onError(err, handler);
}

View File

@ -88,9 +88,11 @@ class HistoryController extends GetxController {
// 观看历史暂停状态
Future historyStatus() async {
var res = await UserHttp.historyStatus();
if (res.data['code'] == 0) {
pauseStatus.value = res.data['data'];
localCache.put(LocalCacheKey.historyPause, res.data['data']);
}
}
// 清空观看历史
Future onClearHistory() async {