Skip to content

Commit ab137ff

Browse files
committed
Support geetest
1 parent 99de185 commit ab137ff

17 files changed

+671
-79
lines changed

app/src/main/assets/captcha.html

Lines changed: 17 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,22 @@
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+
postMessage("challenge_change");
41+
captcha.showCaptcha();
42+
}).onSuccess(function(){
43+
var result = captcha.getValidate();
44+
postToken(result);
45+
}).onClose(function () {
46+
postMessage("gt_close");
47+
});
48+
});
49+
};
3350
</script>
3451
</head>
3552

@@ -40,5 +57,4 @@
4057
<script src="#src" async defer>
4158
</script>
4259
</body>
43-
4460
</html>

0 commit comments

Comments
 (0)