mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-04 17:17:48 +08:00
@@ -1006,4 +1006,6 @@ abstract final class Api {
|
||||
'${HttpString.liveBaseUrl}/xlive/app-ucenter/v1/guard/MainGuardCardAll';
|
||||
|
||||
static const String bubble = '/x/tribee/v1/dyn/all';
|
||||
|
||||
static const String sortFollowTag = '/x/relation/tags/update_sort';
|
||||
}
|
||||
|
||||
@@ -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