mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 07:36:14 +08:00
fix: get不使用options
This commit is contained in:
@@ -28,7 +28,8 @@ class Request {
|
|||||||
late bool enableSystemProxy;
|
late bool enableSystemProxy;
|
||||||
late String systemProxyHost;
|
late String systemProxyHost;
|
||||||
late String systemProxyPort;
|
late String systemProxyPort;
|
||||||
static final RegExp spmPrefixExp = RegExp(r'<meta name="spm_prefix" content="([^"]+?)">');
|
static final RegExp spmPrefixExp =
|
||||||
|
RegExp(r'<meta name="spm_prefix" content="([^"]+?)">');
|
||||||
|
|
||||||
/// 设置cookie
|
/// 设置cookie
|
||||||
static setCookie() async {
|
static setCookie() async {
|
||||||
@@ -97,11 +98,10 @@ class Request {
|
|||||||
String spmPrefix = spmPrefixExp.firstMatch(html.data)!.group(1)!;
|
String spmPrefix = spmPrefixExp.firstMatch(html.data)!.group(1)!;
|
||||||
Random rand = Random();
|
Random rand = Random();
|
||||||
String rand_png_end = base64.encode(
|
String rand_png_end = base64.encode(
|
||||||
List<int>.generate(32, (_) => rand.nextInt(256)) +
|
List<int>.generate(32, (_) => rand.nextInt(256)) +
|
||||||
List<int>.filled(4, 0) +
|
List<int>.filled(4, 0) +
|
||||||
[73, 69, 78, 68] +
|
[73, 69, 78, 68] +
|
||||||
List<int>.generate(4, (_) => rand.nextInt(256))
|
List<int>.generate(4, (_) => rand.nextInt(256)));
|
||||||
);
|
|
||||||
|
|
||||||
String jsonData = json.encode({
|
String jsonData = json.encode({
|
||||||
'3064': 1,
|
'3064': 1,
|
||||||
@@ -112,11 +112,9 @@ class Request {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await Request().post(
|
await Request().post(Api.activateBuvidApi,
|
||||||
Api.activateBuvidApi,
|
data: {'payload': jsonData},
|
||||||
data: {'payload': jsonData},
|
options: Options(contentType: 'application/json'));
|
||||||
options: Options(contentType: 'application/json')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -192,7 +190,7 @@ class Request {
|
|||||||
*/
|
*/
|
||||||
get(url, {data, options, cancelToken, extra}) async {
|
get(url, {data, options, cancelToken, extra}) async {
|
||||||
Response response;
|
Response response;
|
||||||
final Options options = Options();
|
options ??= Options();
|
||||||
ResponseType resType = ResponseType.json;
|
ResponseType resType = ResponseType.json;
|
||||||
if (extra != null) {
|
if (extra != null) {
|
||||||
resType = extra!['resType'] ?? ResponseType.json;
|
resType = extra!['resType'] ?? ResponseType.json;
|
||||||
|
|||||||
Reference in New Issue
Block a user