mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
fix: type cast (#1384)
This commit is contained in:
committed by
GitHub
parent
89e6d5c160
commit
19f7720fb2
@@ -119,12 +119,12 @@ class LoginPageController extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 申请极验验证码
|
// 申请极验验证码
|
||||||
Future<void> getCaptcha(
|
void getCaptcha(
|
||||||
String geeGt,
|
String geeGt,
|
||||||
String geeChallenge,
|
String geeChallenge,
|
||||||
VoidCallback onSuccess,
|
VoidCallback onSuccess,
|
||||||
) async {
|
) {
|
||||||
void updateCaptchaData(Map<String, dynamic> json) {
|
void updateCaptchaData(Map json) {
|
||||||
captchaData
|
captchaData
|
||||||
..validate = json['geetest_validate']
|
..validate = json['geetest_validate']
|
||||||
..seccode = json['geetest_seccode']
|
..seccode = json['geetest_seccode']
|
||||||
@@ -132,18 +132,19 @@ class LoginPageController extends GetxController
|
|||||||
challenge: json['geetest_challenge'],
|
challenge: json['geetest_challenge'],
|
||||||
gt: geeGt,
|
gt: geeGt,
|
||||||
);
|
);
|
||||||
|
SmartDialog.showToast('验证成功');
|
||||||
|
onSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Utils.isDesktop) {
|
if (Utils.isDesktop) {
|
||||||
final res = await Get.dialog<Map<String, dynamic>>(
|
Get.dialog<Map<String, dynamic>>(
|
||||||
GeetestWebviewDialog(geeGt, geeChallenge),
|
GeetestWebviewDialog(geeGt, geeChallenge),
|
||||||
);
|
).then((res) {
|
||||||
if (res != null) {
|
if (res != null) {
|
||||||
updateCaptchaData(res);
|
updateCaptchaData(res);
|
||||||
onSuccess();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
var registerData = Gt3RegisterData(
|
var registerData = Gt3RegisterData(
|
||||||
challenge: geeChallenge,
|
challenge: geeChallenge,
|
||||||
gt: geeGt,
|
gt: geeGt,
|
||||||
@@ -158,12 +159,10 @@ class LoginPageController extends GetxController
|
|||||||
},
|
},
|
||||||
onResult: (Map<String, dynamic> message) {
|
onResult: (Map<String, dynamic> message) {
|
||||||
if (kDebugMode) debugPrint("Captcha result: $message");
|
if (kDebugMode) debugPrint("Captcha result: $message");
|
||||||
String code = message["code"];
|
final String code = message["code"];
|
||||||
if (code == "1") {
|
if (code == "1") {
|
||||||
// 发送 message["result"] 中的数据向 B 端的业务服务接口进行查询
|
// 发送 message["result"] 中的数据向 B 端的业务服务接口进行查询
|
||||||
SmartDialog.showToast('验证成功');
|
|
||||||
updateCaptchaData(message['result']);
|
updateCaptchaData(message['result']);
|
||||||
onSuccess();
|
|
||||||
} else {
|
} else {
|
||||||
// 终端用户完成验证失败,自动重试 If the verification fails, it will be automatically retried.
|
// 终端用户完成验证失败,自动重试 If the verification fails, it will be automatically retried.
|
||||||
if (kDebugMode) debugPrint("Captcha result code : $code");
|
if (kDebugMode) debugPrint("Captcha result code : $code");
|
||||||
@@ -233,6 +232,7 @@ class LoginPageController extends GetxController
|
|||||||
)
|
)
|
||||||
..startCaptcha(registerData);
|
..startCaptcha(registerData);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// cookie登录
|
// cookie登录
|
||||||
Future<void> loginByCookie() async {
|
Future<void> loginByCookie() async {
|
||||||
|
|||||||
Reference in New Issue
Block a user