mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-15 05:33:59 +08:00
@@ -3,6 +3,8 @@ import 'package:PiliPlus/http/error_msg.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models_new/follow/data.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:dio/dio.dart' show Options, Headers;
|
||||
|
||||
abstract final class FollowHttp {
|
||||
static Future<LoadingState<FollowData>> followings({
|
||||
@@ -27,4 +29,26 @@ abstract final class FollowHttp {
|
||||
return Error(errorMsg[res.data['code']] ?? res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<void>> sortFollowTag({
|
||||
required String tagids,
|
||||
}) async {
|
||||
final res = await Request().post(
|
||||
Api.sortFollowTag,
|
||||
queryParameters: {
|
||||
'x-bili-device-req-json':
|
||||
'{"platform":"web","device":"pc","spmid":"333.1387"}',
|
||||
},
|
||||
data: {
|
||||
'tagids': tagids,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return const Success(null);
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user