mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
opt ui
fix report im msg Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
@@ -609,4 +611,33 @@ abstract final class MsgHttp {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<Null>> imMsgReport({
|
||||
required Object accusedUid,
|
||||
required int reasonType,
|
||||
required String reasonDesc,
|
||||
required Map comment,
|
||||
required Map extra,
|
||||
}) async {
|
||||
final res = await Request().post(
|
||||
Api.imMsgReport,
|
||||
data: {
|
||||
'biz_code': 4,
|
||||
'accused_uid': accusedUid,
|
||||
'object_id': accusedUid,
|
||||
'reason_type': reasonType,
|
||||
'reason_desc': reasonDesc,
|
||||
'module': 604,
|
||||
'comment': jsonEncode(comment),
|
||||
'extra': jsonEncode(extra),
|
||||
'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