Skip to content

Commit e326049

Browse files
SeniorZhaicrossleCopilot
authored
Feature/geetest (#5819)
* Support geetest * Update * Handel retry error * Fix handle logic * Update app/src/main/java/one/mixin/android/widget/CaptchaView.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use constants --------- Co-authored-by: Crossle Song <crosslesong@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent bae6112 commit e326049

18 files changed

+739
-81
lines changed

app/src/main/assets/captcha.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<head>
44
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
5+
#gt
56
<script type="text/javascript">
67

78
var postToken = function (response) {
@@ -30,6 +31,21 @@
3031
hcaptcha.execute(widgetID);
3132
}
3233

34+
var initGTCaptcha = function() {
35+
initGeetest4({
36+
captchaId: '#apiKey',
37+
product: 'bind'
38+
}, function(captcha) {
39+
captcha.onReady(function(){
40+
captcha.showCaptcha();
41+
}).onSuccess(function(){
42+
var result = captcha.getValidate();
43+
postToken(JSON.stringify(result));
44+
}).onClose(function () {
45+
postMessage("gt_close");
46+
});
47+
});
48+
};
3349
</script>
3450
</head>
3551

@@ -40,5 +56,4 @@
4056
<script src="#src" async defer>
4157
</script>
4258
</body>
43-
4459
</html>

0 commit comments

Comments
 (0)