feat: 删除已观看历史记录 issues #81

This commit is contained in:
guozhigq
2023-09-11 17:36:05 +08:00
parent 0e39453558
commit ef38844798
5 changed files with 67 additions and 4 deletions

View File

@ -164,6 +164,9 @@ class Api {
// 清空历史记录
static const String clearHistory = '/x/v2/history/clear';
// 删除某条历史记录
static const String delHistory = '/x/v2/history/delete';
// 热搜
static const String hotSearchList =
'https://s.search.bilibili.com/main/hotword';

View File

@ -231,4 +231,21 @@ class UserHttp {
return {'status': false, 'msg': res.data['message']};
}
}
// 删除历史记录
static Future delHistory(kid) async {
var res = await Request().post(
Api.delHistory,
queryParameters: {
'kid': 'archive_$kid',
'jsonp': 'jsonp',
'csrf': await Request.getCsrf(),
},
);
if (res.data['code'] == 0) {
return {'status': true, 'msg': '已删除'};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
}