opt: merge fav,follow,history search

This commit is contained in:
bggRGjQaUbCoE
2024-09-13 18:01:06 +08:00
parent b7d115c3ae
commit c78c688002
16 changed files with 160 additions and 472 deletions

View File

@@ -286,7 +286,7 @@ class UserHttp {
// }
// 搜索历史记录
static Future searchHistory(
static Future<LoadingState> searchHistory(
{required int pn, required String keyword}) async {
var res = await Request().get(
Api.searchHistory,
@@ -297,9 +297,9 @@ class UserHttp {
},
);
if (res.data['code'] == 0) {
return {'status': true, 'data': HistoryData.fromJson(res.data['data'])};
return LoadingState.success(HistoryData.fromJson(res.data['data']));
} else {
return {'status': false, 'msg': res.data['message']};
return LoadingState.error(res.data['message']);
}
}