Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-21 17:33:31 +08:00
parent 3d0fedfb61
commit 4190c17cdc
3 changed files with 26 additions and 8 deletions

View File

@@ -284,7 +284,7 @@ class Request {
token.cancel("cancelled"); token.cancel("cancelled");
} }
String headerUa({type = 'mob'}) { static String headerUa({type = 'mob'}) {
String headerUa = ''; String headerUa = '';
if (type == 'mob') { if (type == 'mob') {
if (Platform.isIOS) { if (Platform.isIOS) {

View File

@@ -820,12 +820,30 @@ class VideoHttp {
// 操作用户关系 // 操作用户关系
static Future relationMod( static Future relationMod(
{required int mid, required int act, required int reSrc}) async { {required int mid, required int act, required int reSrc}) async {
var res = await Request().post(Api.relationMod, queryParameters: { var res = await Request().post(
'fid': mid, Api.relationMod,
'act': act, data: {
're_src': reSrc, 'fid': mid,
'csrf': await Request.getCsrf(), '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) { if (res.data['code'] == 0) {
return {'status': true}; return {'status': true};
} else { } else {

View File

@@ -171,7 +171,7 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
useHybridComposition: false, useHybridComposition: false,
algorithmicDarkeningAllowed: true, algorithmicDarkeningAllowed: true,
useShouldOverrideUrlLoading: true, useShouldOverrideUrlLoading: true,
userAgent: Request().headerUa(type: uaType), userAgent: Request.headerUa(type: uaType),
mixedContentMode: MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW, mixedContentMode: MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW,
), ),
initialUrlRequest: initialUrlRequest: