diff --git a/lib/http/init.dart b/lib/http/init.dart
index 18bccb65c..50d7e650e 100644
--- a/lib/http/init.dart
+++ b/lib/http/init.dart
@@ -28,7 +28,8 @@ class Request {
late bool enableSystemProxy;
late String systemProxyHost;
late String systemProxyPort;
- static final RegExp spmPrefixExp = RegExp(r'');
+ static final RegExp spmPrefixExp =
+ RegExp(r'');
/// 设置cookie
static setCookie() async {
@@ -97,11 +98,10 @@ class Request {
String spmPrefix = spmPrefixExp.firstMatch(html.data)!.group(1)!;
Random rand = Random();
String rand_png_end = base64.encode(
- List.generate(32, (_) => rand.nextInt(256)) +
- List.filled(4, 0) +
- [73, 69, 78, 68] +
- List.generate(4, (_) => rand.nextInt(256))
- );
+ List.generate(32, (_) => rand.nextInt(256)) +
+ List.filled(4, 0) +
+ [73, 69, 78, 68] +
+ List.generate(4, (_) => rand.nextInt(256)));
String jsonData = json.encode({
'3064': 1,
@@ -112,11 +112,9 @@ class Request {
},
});
- await Request().post(
- Api.activateBuvidApi,
- data: {'payload': jsonData},
- options: Options(contentType: 'application/json')
- );
+ await Request().post(Api.activateBuvidApi,
+ data: {'payload': jsonData},
+ options: Options(contentType: 'application/json'));
}
/*
@@ -192,7 +190,7 @@ class Request {
*/
get(url, {data, options, cancelToken, extra}) async {
Response response;
- final Options options = Options();
+ options ??= Options();
ResponseType resType = ResponseType.json;
if (extra != null) {
resType = extra!['resType'] ?? ResponseType.json;