mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -284,7 +284,7 @@ class Request {
|
||||
token.cancel("cancelled");
|
||||
}
|
||||
|
||||
String headerUa({type = 'mob'}) {
|
||||
static String headerUa({type = 'mob'}) {
|
||||
String headerUa = '';
|
||||
if (type == 'mob') {
|
||||
if (Platform.isIOS) {
|
||||
|
||||
@@ -820,12 +820,30 @@ class VideoHttp {
|
||||
// 操作用户关系
|
||||
static Future relationMod(
|
||||
{required int mid, required int act, required int reSrc}) async {
|
||||
var res = await Request().post(Api.relationMod, queryParameters: {
|
||||
'fid': mid,
|
||||
'act': act,
|
||||
're_src': reSrc,
|
||||
'csrf': await Request.getCsrf(),
|
||||
});
|
||||
var res = await Request().post(
|
||||
Api.relationMod,
|
||||
data: {
|
||||
'fid': mid,
|
||||
'act': act,
|
||||
're_src': reSrc,
|
||||
'gaia_source': 'web_main',
|
||||
'spmid': '333.999.0.0',
|
||||
'extend_content': {
|
||||
"entity": "user",
|
||||
"entity_id": mid,
|
||||
'fp': Request.headerUa(type: 'pc'),
|
||||
},
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
options: Options(
|
||||
contentType: Headers.formUrlEncodedContentType,
|
||||
headers: {
|
||||
'origin': 'https://space.bilibili.com',
|
||||
'referer': 'https://space.bilibili.com/$mid/dynamic',
|
||||
'user-agent': Request.headerUa(type: 'pc'),
|
||||
},
|
||||
),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true};
|
||||
} else {
|
||||
|
||||
@@ -171,7 +171,7 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
|
||||
useHybridComposition: false,
|
||||
algorithmicDarkeningAllowed: true,
|
||||
useShouldOverrideUrlLoading: true,
|
||||
userAgent: Request().headerUa(type: uaType),
|
||||
userAgent: Request.headerUa(type: uaType),
|
||||
mixedContentMode: MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW,
|
||||
),
|
||||
initialUrlRequest:
|
||||
|
||||
Reference in New Issue
Block a user