mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-05 17:47:46 +08:00
tweak (#1325)
* tweak * opt: async * tweak * opt: PopularSeries tile * tweak * opt: sc * mod: more account type * tweak * opt: qrcode * tweak * partial revert: opt: sc * fix * fix * mod: window enqueue
This commit is contained in:
committed by
GitHub
parent
67c25bd130
commit
4ae3bd2845
@@ -1,26 +0,0 @@
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
|
||||
class CommonHttp {
|
||||
static Future unReadDynamic() async {
|
||||
var res = await Request().get(
|
||||
Api.getUnreadDynamic,
|
||||
queryParameters: {
|
||||
'alltype_offset': 0,
|
||||
'video_offset': 0,
|
||||
'article_offset': 0,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data']['update_info']['item']['count'],
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,8 @@ class LoginHttp {
|
||||
'content-type': 'application/x-www-form-urlencoded; charset=utf-8',
|
||||
};
|
||||
|
||||
static Future<Map<String, dynamic>> getHDcode() async {
|
||||
static Future<LoadingState<({String authCode, String url})>>
|
||||
getHDcode() async {
|
||||
var params = {
|
||||
// 'local_id': 'Y952A395BB157D305D8A8340FC2AAECECE17',
|
||||
'local_id': '0',
|
||||
@@ -42,9 +43,14 @@ class LoginHttp {
|
||||
var res = await Request().post(Api.getTVCode, queryParameters: params);
|
||||
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
try {
|
||||
final Map<String, dynamic> data = res.data['data'];
|
||||
return Success((authCode: data['auth_code'], url: data['url']));
|
||||
} catch (e) {
|
||||
return Error(e.toString());
|
||||
}
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +94,7 @@ class LoginHttp {
|
||||
}
|
||||
|
||||
static Future sendSmsCode({
|
||||
required String cid,
|
||||
required Object cid,
|
||||
required String tel,
|
||||
// String? deviceTouristId,
|
||||
String? geeChallenge,
|
||||
@@ -264,11 +270,11 @@ class LoginHttp {
|
||||
required String captchaKey,
|
||||
required String tel,
|
||||
required String code,
|
||||
required String cid,
|
||||
required Object cid,
|
||||
required String key,
|
||||
}) async {
|
||||
dynamic publicKey = RSAKeyParser().parse(key);
|
||||
Map<String, String> data = {
|
||||
Map<String, Object> data = {
|
||||
'bili_local_id': deviceId,
|
||||
'build': '2001100',
|
||||
'buvid': buvid,
|
||||
@@ -297,7 +303,7 @@ class LoginHttp {
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statistics,
|
||||
'tel': tel,
|
||||
'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(),
|
||||
'ts': DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||
};
|
||||
AppSign.appSign(data);
|
||||
var res = await Request().post(
|
||||
|
||||
Reference in New Issue
Block a user