From d2502585282ffcd436ce5cbbd7467eba405af3da Mon Sep 17 00:00:00 2001 From: orz12 Date: Mon, 9 Sep 2024 08:18:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ab2c=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/search.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/http/search.dart b/lib/http/search.dart index da3a1125..0fcd6224 100644 --- a/lib/http/search.dart +++ b/lib/http/search.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:hive/hive.dart'; import '../models/bangumi/info.dart'; import '../models/common/search_type.dart'; @@ -139,7 +140,12 @@ class SearchHttp { } final dynamic res = await Request().get(Api.ab2c, data: {...data}); - return res.data['data'].first['cid']; + if (res.data['code'] == 0) { + return res.data['data'].first['cid']; + } else { + SmartDialog.showToast("ab2c error: ${res.data['message']}"); + return -1; + } } static Future> bangumiInfo(