feat: 取消订阅 issues #606

This commit is contained in:
guozhigq
2024-03-09 00:22:58 +08:00
parent b248158e62
commit bc26e79bf9
5 changed files with 86 additions and 5 deletions

View File

@ -490,6 +490,9 @@ class Api {
/// 我的订阅详情
static const userSubFolderDetail = '/x/space/fav/season/list';
/// 取消订阅
static const userSubCancel = '/x/v3/fav/season/unfav';
/// 表情
static const emojiList = '/x/emote/user/panel/web';

View File

@ -349,4 +349,21 @@ class UserHttp {
return {'status': false, 'msg': res.data['message']};
}
}
// 取消订阅
static Future userSubCancel({required int seasonId}) async {
var res = await Request().post(
Api.userSubCancel,
queryParameters: {
'season_id': seasonId,
'platform': 'web',
'csrf': await Request.getCsrf(),
},
);
if (res.data['code'] == 0) {
return {'status': true, 'msg': '取消订阅成功'};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
}