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