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");
}
String headerUa({type = 'mob'}) {
static String headerUa({type = 'mob'}) {
String headerUa = '';
if (type == 'mob') {
if (Platform.isIOS) {

View File

@@ -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 {

View File

@@ -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: