mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: bangumi triple
This commit is contained in:
@@ -108,6 +108,8 @@ class Api {
|
||||
// csrf str CSRF Token(位于cookie) 必要
|
||||
static const String oneThree = '/x/web-interface/archive/like/triple';
|
||||
|
||||
static const String triple = '/pgc/season/episode/like/triple';
|
||||
|
||||
// 获取指定用户创建的所有收藏夹信息
|
||||
// 该接口也能查询目标内容id存在于那些收藏夹中
|
||||
// up_mid num 目标用户mid 必要
|
||||
|
||||
@@ -348,6 +348,27 @@ class VideoHttp {
|
||||
}
|
||||
}
|
||||
|
||||
// 一键三连 bangumi
|
||||
static Future triple({dynamic epId}) async {
|
||||
var res = await Request().post(
|
||||
Api.triple,
|
||||
data: {
|
||||
'ep_id': epId,
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
options: Options(
|
||||
headers: {
|
||||
'Content-Type': Headers.formUrlEncodedContentType,
|
||||
},
|
||||
),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
} else {
|
||||
return {'status': false, 'data': [], 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
// 一键三连
|
||||
static Future oneThree({required String bvid}) async {
|
||||
var res = await Request().post(
|
||||
@@ -533,11 +554,6 @@ class VideoHttp {
|
||||
var res = await Request().post(
|
||||
Api.replyAdd,
|
||||
data: FormData.fromMap(data),
|
||||
options: Options(
|
||||
headers: {
|
||||
'Content-Type': Headers.formUrlEncodedContentType,
|
||||
},
|
||||
),
|
||||
);
|
||||
log(res.toString());
|
||||
if (res.data['code'] == 0) {
|
||||
|
||||
@@ -430,11 +430,11 @@ class BangumiIntroController extends CommonController {
|
||||
SmartDialog.showToast('已三连');
|
||||
return false;
|
||||
}
|
||||
var result = await VideoHttp.oneThree(bvid: bvid);
|
||||
var result = await VideoHttp.triple(epId: epId);
|
||||
if (result['status']) {
|
||||
hasLike.value = result["data"]["like"];
|
||||
hasCoin.value = result["data"]["coin"];
|
||||
hasFav.value = result["data"]["fav"];
|
||||
hasLike.value = result["data"]["like"] == 1;
|
||||
hasCoin.value = result["data"]["coin"] == 1;
|
||||
hasFav.value = result["data"]["favorite"] == 1;
|
||||
SmartDialog.showToast('三连成功');
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
|
||||
Reference in New Issue
Block a user