mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-15 13:50:14 +08:00
mod: csrf
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
|
|
||||||
import '../models/user/black.dart';
|
import '../models/user/black.dart';
|
||||||
import 'index.dart';
|
import 'index.dart';
|
||||||
@@ -11,7 +12,7 @@ class BlackHttp {
|
|||||||
'ps': ps ?? 50,
|
'ps': ps ?? 50,
|
||||||
're_version': 0,
|
're_version': 0,
|
||||||
'jsonp': 'jsonp',
|
'jsonp': 'jsonp',
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
});
|
});
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
BlackListDataModel data = BlackListDataModel.fromJson(res.data['data']);
|
BlackListDataModel data = BlackListDataModel.fromJson(res.data['data']);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:PiliPlus/grpc/dm/v1/dm.pb.dart';
|
import 'package:PiliPlus/grpc/dm/v1/dm.pb.dart';
|
||||||
import 'package:PiliPlus/grpc/grpc_repo.dart';
|
import 'package:PiliPlus/grpc/grpc_repo.dart';
|
||||||
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'index.dart';
|
import 'index.dart';
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@ class DanmakuHttp {
|
|||||||
'rnd': DateTime.now().microsecondsSinceEpoch,
|
'rnd': DateTime.now().microsecondsSinceEpoch,
|
||||||
'colorful': colorful == true ? 60001 : null,
|
'colorful': colorful == true ? 60001 : null,
|
||||||
'checkbox_type': checkbox_type,
|
'checkbox_type': checkbox_type,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
// 'access_key': access_key,
|
// 'access_key': access_key,
|
||||||
}..removeWhere((key, value) => value == null);
|
}..removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import '../models/user/danmaku_block.dart';
|
import '../models/user/danmaku_block.dart';
|
||||||
|
import '../utils/storage.dart';
|
||||||
import 'index.dart';
|
import 'index.dart';
|
||||||
|
|
||||||
class DanmakuFilterHttp {
|
class DanmakuFilterHttp {
|
||||||
@@ -22,7 +23,7 @@ class DanmakuFilterHttp {
|
|||||||
Api.danmakuFilterDel,
|
Api.danmakuFilterDel,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'ids': ids,
|
'ids': ids,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
@@ -45,7 +46,7 @@ class DanmakuFilterHttp {
|
|||||||
queryParameters: {
|
queryParameters: {
|
||||||
'type': type,
|
'type': type,
|
||||||
'filter': filter,
|
'filter': filter,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class DynamicsHttp {
|
|||||||
queryParameters: {
|
queryParameters: {
|
||||||
'dynamic_id': dynamicId,
|
'dynamic_id': dynamicId,
|
||||||
'up': up,
|
'up': up,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
@@ -125,7 +125,7 @@ class DynamicsHttp {
|
|||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
Api.setTopDyn,
|
Api.setTopDyn,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
'dyn_str': dynamicId,
|
'dyn_str': dynamicId,
|
||||||
|
|||||||
@@ -61,11 +61,6 @@ class Request {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从cookie中获取 csrf token
|
|
||||||
static Future<String> getCsrf() async {
|
|
||||||
return Accounts.main.csrf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static Future<void> buvidActive(Account account) async {
|
// static Future<void> buvidActive(Account account) async {
|
||||||
// // 这样线程不安全, 但仍按预期进行
|
// // 这样线程不安全, 但仍按预期进行
|
||||||
// if (account.activited) return;
|
// if (account.activited) return;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/models/live/danmu_info.dart';
|
|||||||
import 'package:PiliPlus/models/live/follow.dart';
|
import 'package:PiliPlus/models/live/follow.dart';
|
||||||
import 'package:PiliPlus/models/live/live_emoticons/data.dart';
|
import 'package:PiliPlus/models/live/live_emoticons/data.dart';
|
||||||
import 'package:PiliPlus/models/live/live_emoticons/datum.dart';
|
import 'package:PiliPlus/models/live/live_emoticons/datum.dart';
|
||||||
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import '../models/live/item.dart';
|
import '../models/live/item.dart';
|
||||||
@@ -42,7 +43,7 @@ class LiveHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future sendLiveMsg({roomId, msg, dmType, emoticonOptions}) async {
|
static Future sendLiveMsg({roomId, msg, dmType, emoticonOptions}) async {
|
||||||
dynamic csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
Api.sendLiveMsg,
|
Api.sendLiveMsg,
|
||||||
data: FormData.fromMap({
|
data: FormData.fromMap({
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class MemberHttp {
|
|||||||
'mid': mid,
|
'mid': mid,
|
||||||
'reason': reason,
|
'reason': reason,
|
||||||
if (reasonV2 != null) 'reason_v2': reasonV2,
|
if (reasonV2 != null) 'reason_v2': reasonV2,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -476,7 +476,7 @@ class MemberHttp {
|
|||||||
isAdd ? Api.addSpecial : Api.delSpecial,
|
isAdd ? Api.addSpecial : Api.delSpecial,
|
||||||
data: {
|
data: {
|
||||||
'fid': fid,
|
'fid': fid,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
@@ -499,7 +499,7 @@ class MemberHttp {
|
|||||||
data: {
|
data: {
|
||||||
'fids': fids,
|
'fids': fids,
|
||||||
'tagids': tagids ?? '0',
|
'tagids': tagids ?? '0',
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
// 'cross_domain': true
|
// 'cross_domain': true
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:PiliPlus/models/msg/msgfeed_like_me.dart';
|
|||||||
import 'package:PiliPlus/models/msg/msgfeed_reply_me.dart';
|
import 'package:PiliPlus/models/msg/msgfeed_reply_me.dart';
|
||||||
import 'package:PiliPlus/models/msg/msgfeed_sys_msg.dart';
|
import 'package:PiliPlus/models/msg/msgfeed_sys_msg.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/view.dart' show ReplyOption;
|
import 'package:PiliPlus/pages/dynamics/view.dart' show ReplyOption;
|
||||||
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
@@ -85,7 +86,7 @@ class MsgHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future msgSysUpdateCursor(int cursor) async {
|
static Future msgSysUpdateCursor(int cursor) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
var res = await Request().get(Api.msgSysUpdateCursor, queryParameters: {
|
var res = await Request().get(Api.msgSysUpdateCursor, queryParameters: {
|
||||||
'csrf': csrf,
|
'csrf': csrf,
|
||||||
'cursor': cursor,
|
'cursor': cursor,
|
||||||
@@ -125,7 +126,7 @@ class MsgHttp {
|
|||||||
ReplyOption? replyOption,
|
ReplyOption? replyOption,
|
||||||
int? privatePub,
|
int? privatePub,
|
||||||
}) async {
|
}) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
Api.createDynamic,
|
Api.createDynamic,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
@@ -204,7 +205,7 @@ class MsgHttp {
|
|||||||
'bucket': bucket,
|
'bucket': bucket,
|
||||||
'file': await MultipartFile.fromFile(path),
|
'file': await MultipartFile.fromFile(path),
|
||||||
'dir': dir,
|
'dir': dir,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
@@ -231,7 +232,7 @@ class MsgHttp {
|
|||||||
'file_up': file,
|
'file_up': file,
|
||||||
if (category != null) 'category': category,
|
if (category != null) 'category': category,
|
||||||
if (biz != null) 'biz': biz,
|
if (biz != null) 'biz': biz,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
};
|
};
|
||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
Api.uploadBfs,
|
Api.uploadBfs,
|
||||||
@@ -254,7 +255,7 @@ class MsgHttp {
|
|||||||
static Future createTextDynamic(
|
static Future createTextDynamic(
|
||||||
dynamic content,
|
dynamic content,
|
||||||
) async {
|
) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
Map<String, dynamic> data = await WbiSign.makSign({
|
Map<String, dynamic> data = await WbiSign.makSign({
|
||||||
'dynamic_id': 0,
|
'dynamic_id': 0,
|
||||||
'type': 4,
|
'type': 4,
|
||||||
@@ -280,7 +281,7 @@ class MsgHttp {
|
|||||||
static Future removeDynamic(
|
static Future removeDynamic(
|
||||||
dynamic dynamicId,
|
dynamic dynamicId,
|
||||||
) async {
|
) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
Map<String, dynamic> data = await WbiSign.makSign({
|
Map<String, dynamic> data = await WbiSign.makSign({
|
||||||
'dynamic_id': dynamicId,
|
'dynamic_id': dynamicId,
|
||||||
'csrf_token': csrf,
|
'csrf_token': csrf,
|
||||||
@@ -303,7 +304,7 @@ class MsgHttp {
|
|||||||
static Future removeMsg(
|
static Future removeMsg(
|
||||||
dynamic talkerId,
|
dynamic talkerId,
|
||||||
) async {
|
) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
Map<String, dynamic> data = await WbiSign.makSign({
|
Map<String, dynamic> data = await WbiSign.makSign({
|
||||||
'talker_id': talkerId,
|
'talker_id': talkerId,
|
||||||
'session_type': 1,
|
'session_type': 1,
|
||||||
@@ -327,7 +328,7 @@ class MsgHttp {
|
|||||||
int tp,
|
int tp,
|
||||||
dynamic id,
|
dynamic id,
|
||||||
) async {
|
) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
Api.delMsgfeed,
|
Api.delMsgfeed,
|
||||||
data: {
|
data: {
|
||||||
@@ -355,7 +356,7 @@ class MsgHttp {
|
|||||||
static Future delSysMsg(
|
static Future delSysMsg(
|
||||||
dynamic id,
|
dynamic id,
|
||||||
) async {
|
) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
HttpString.messageBaseUrl + Api.delSysMsg,
|
HttpString.messageBaseUrl + Api.delSysMsg,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
@@ -384,7 +385,7 @@ class MsgHttp {
|
|||||||
required dynamic talkerId,
|
required dynamic talkerId,
|
||||||
required int opType,
|
required int opType,
|
||||||
}) async {
|
}) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
Map<String, dynamic> data = await WbiSign.makSign({
|
Map<String, dynamic> data = await WbiSign.makSign({
|
||||||
'talker_id': talkerId,
|
'talker_id': talkerId,
|
||||||
'session_type': 1,
|
'session_type': 1,
|
||||||
@@ -485,7 +486,7 @@ class MsgHttp {
|
|||||||
int? talkerId,
|
int? talkerId,
|
||||||
int? ackSeqno,
|
int? ackSeqno,
|
||||||
}) async {
|
}) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
Map params = await WbiSign.makSign({
|
Map params = await WbiSign.makSign({
|
||||||
'talker_id': talkerId,
|
'talker_id': talkerId,
|
||||||
'session_type': 1,
|
'session_type': 1,
|
||||||
@@ -519,7 +520,7 @@ class MsgHttp {
|
|||||||
int? msgType,
|
int? msgType,
|
||||||
dynamic content,
|
dynamic content,
|
||||||
}) async {
|
}) async {
|
||||||
String csrf = await Request.getCsrf();
|
String csrf = Accounts.main.csrf;
|
||||||
Map<String, dynamic> base = {
|
Map<String, dynamic> base = {
|
||||||
'msg[sender_uid]': senderUid,
|
'msg[sender_uid]': senderUid,
|
||||||
'msg[receiver_id]': receiverId,
|
'msg[receiver_id]': receiverId,
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ class ReplyHttp {
|
|||||||
'pn': pageNum,
|
'pn': pageNum,
|
||||||
'type': type,
|
'type': type,
|
||||||
'sort': 1,
|
'sort': 1,
|
||||||
if (isLogin) 'csrf': await Request.getCsrf(),
|
if (isLogin) 'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: isLogin.not ? _options : null,
|
options: isLogin.not ? _options : null,
|
||||||
);
|
);
|
||||||
@@ -342,7 +342,7 @@ class ReplyHttp {
|
|||||||
'oid': oid,
|
'oid': oid,
|
||||||
'rpid': rpid,
|
'rpid': rpid,
|
||||||
'action': action,
|
'action': action,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
@@ -369,7 +369,7 @@ class ReplyHttp {
|
|||||||
'oid': oid,
|
'oid': oid,
|
||||||
'rpid': rpid,
|
'rpid': rpid,
|
||||||
'action': action,
|
'action': action,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
@@ -406,7 +406,7 @@ class ReplyHttp {
|
|||||||
'type': type,
|
'type': type,
|
||||||
'rpid': rpid,
|
'rpid': rpid,
|
||||||
'action': isUpTop ? 0 : 1,
|
'action': isUpTop ? 0 : 1,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/video/later.dart';
|
import 'package:PiliPlus/models/video/later.dart';
|
||||||
import 'package:PiliPlus/utils/global_data.dart';
|
import 'package:PiliPlus/utils/global_data.dart';
|
||||||
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
@@ -71,7 +72,7 @@ class UserHttp {
|
|||||||
}) async {
|
}) async {
|
||||||
Map<String, dynamic> data = {
|
Map<String, dynamic> data = {
|
||||||
'sort': sort.join(','),
|
'sort': sort.join(','),
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
};
|
};
|
||||||
Utils.appSign(data);
|
Utils.appSign(data);
|
||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
@@ -95,7 +96,7 @@ class UserHttp {
|
|||||||
Map<String, dynamic> data = {
|
Map<String, dynamic> data = {
|
||||||
'media_id': mediaId,
|
'media_id': mediaId,
|
||||||
'sort': sort.join(','),
|
'sort': sort.join(','),
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
};
|
};
|
||||||
Utils.appSign(data);
|
Utils.appSign(data);
|
||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
@@ -120,7 +121,7 @@ class UserHttp {
|
|||||||
data: {
|
data: {
|
||||||
'media_id': mediaId,
|
'media_id': mediaId,
|
||||||
'platform': 'web',
|
'platform': 'web',
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
@@ -140,7 +141,7 @@ class UserHttp {
|
|||||||
data: {
|
data: {
|
||||||
'media_ids': mediaIds.join(','),
|
'media_ids': mediaIds.join(','),
|
||||||
'platform': 'web',
|
'platform': 'web',
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
@@ -166,7 +167,7 @@ class UserHttp {
|
|||||||
'intro': intro,
|
'intro': intro,
|
||||||
'privacy': privacy,
|
'privacy': privacy,
|
||||||
'cover': cover.isNotEmpty ? Uri.encodeFull(cover) : cover,
|
'cover': cover.isNotEmpty ? Uri.encodeFull(cover) : cover,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
if (mediaId != null) 'media_id': mediaId,
|
if (mediaId != null) 'media_id': mediaId,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
@@ -284,7 +285,7 @@ class UserHttp {
|
|||||||
queryParameters: {
|
queryParameters: {
|
||||||
'switch': switchStatus,
|
'switch': switchStatus,
|
||||||
'jsonp': 'jsonp',
|
'jsonp': 'jsonp',
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return res;
|
return res;
|
||||||
@@ -306,7 +307,7 @@ class UserHttp {
|
|||||||
Api.clearHistory,
|
Api.clearHistory,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'jsonp': 'jsonp',
|
'jsonp': 'jsonp',
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return res;
|
return res;
|
||||||
@@ -314,7 +315,7 @@ class UserHttp {
|
|||||||
|
|
||||||
// 稍后再看
|
// 稍后再看
|
||||||
static Future toViewLater({String? bvid, dynamic aid}) async {
|
static Future toViewLater({String? bvid, dynamic aid}) async {
|
||||||
var data = {'csrf': await Request.getCsrf()};
|
var data = {'csrf': Accounts.main.csrf};
|
||||||
if (bvid != null) {
|
if (bvid != null) {
|
||||||
data['bvid'] = bvid;
|
data['bvid'] = bvid;
|
||||||
} else if (aid != null) {
|
} else if (aid != null) {
|
||||||
@@ -334,7 +335,7 @@ class UserHttp {
|
|||||||
// 移除已观看
|
// 移除已观看
|
||||||
static Future toViewDel({required List<int?> aids}) async {
|
static Future toViewDel({required List<int?> aids}) async {
|
||||||
final Map<String, dynamic> params = {
|
final Map<String, dynamic> params = {
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
'resources': aids.join(',')
|
'resources': aids.join(',')
|
||||||
};
|
};
|
||||||
dynamic res = await Request().post(
|
dynamic res = await Request().post(
|
||||||
@@ -374,7 +375,7 @@ class UserHttp {
|
|||||||
Api.toViewClear,
|
Api.toViewClear,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
if (cleanType != null) 'clean_type': cleanType,
|
if (cleanType != null) 'clean_type': cleanType,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
@@ -391,7 +392,7 @@ class UserHttp {
|
|||||||
data: {
|
data: {
|
||||||
'kid': kidList.join(','),
|
'kid': kidList.join(','),
|
||||||
'jsonp': 'jsonp',
|
'jsonp': 'jsonp',
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
@@ -524,7 +525,7 @@ class UserHttp {
|
|||||||
Api.addFavArticle,
|
Api.addFavArticle,
|
||||||
data: {
|
data: {
|
||||||
'id': id,
|
'id': id,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
@@ -544,7 +545,7 @@ class UserHttp {
|
|||||||
Api.delFavArticle,
|
Api.delFavArticle,
|
||||||
data: {
|
data: {
|
||||||
'id': id,
|
'id': id,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
@@ -564,7 +565,7 @@ class UserHttp {
|
|||||||
var res = await Request().post(
|
var res = await Request().post(
|
||||||
Api.communityAction,
|
Api.communityAction,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
"entity": {
|
"entity": {
|
||||||
@@ -609,7 +610,7 @@ class UserHttp {
|
|||||||
Api.unfavFolder,
|
Api.unfavFolder,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'media_id': id,
|
'media_id': id,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -618,7 +619,7 @@ class UserHttp {
|
|||||||
queryParameters: {
|
queryParameters: {
|
||||||
'platform': 'web',
|
'platform': 'web',
|
||||||
'season_id': id,
|
'season_id': id,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -823,7 +823,7 @@ class VideoHttp {
|
|||||||
await Request().post(
|
await Request().post(
|
||||||
Api.roomEntryAction,
|
Api.roomEntryAction,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
'room_id': roomId,
|
'room_id': roomId,
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
final res = await Request().post(
|
final res = await Request().post(
|
||||||
'/x/dynamic/feed/dynamic_report/add',
|
'/x/dynamic/feed/dynamic_report/add',
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
"accused_uid": item.modules.moduleAuthor.mid,
|
"accused_uid": item.modules.moduleAuthor.mid,
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ class _EditProfilePageState extends State<EditProfilePage> {
|
|||||||
.post(
|
.post(
|
||||||
'/x/member/web/face/update',
|
'/x/member/web/face/update',
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
},
|
},
|
||||||
data: FormData.fromMap({
|
data: FormData.fromMap({
|
||||||
'dopost': 'save',
|
'dopost': 'save',
|
||||||
|
|||||||
@@ -1104,7 +1104,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
'/x/v2/reply/report',
|
'/x/v2/reply/report',
|
||||||
data: {
|
data: {
|
||||||
'add_blacklist': banUid,
|
'add_blacklist': banUid,
|
||||||
'csrf': await Request.getCsrf(),
|
'csrf': Accounts.main.csrf,
|
||||||
'gaia_source': 'main_h5',
|
'gaia_source': 'main_h5',
|
||||||
'oid': item.oid,
|
'oid': item.oid,
|
||||||
'platform': 'android',
|
'platform': 'android',
|
||||||
|
|||||||
Reference in New Issue
Block a user