PageSourceSearch

https://zhiliangku.cn/ViewScripts/Login/GraphAuthCaptcha.js?v=20260820

js zhiliangku.cn collected 2026-10-05 07:34:51 UTC 2,470 bytes, 78 lines download raw bytes

1(function (window) {
2    'use strict';
3
4    function create(options) {
5        options = options || {};
6
7        var captchaId = options.captchaId || '';
8        var captcha = null;
9        var loadFailed = false;
10        var pending = null;
11
12        function fail(message) {
13            var request = pending;
14            pending = null;
15            if (request && typeof request.onError === 'function') {
16                request.onError(message);
17            }
18        }
19
20        if (captchaId && typeof window.initAlicom4 === 'function') {
21            window.initAlicom4({
22                captchaId: captchaId,
23                product: 'bind'
24            }, function (instance) {
25                captcha = instance;
26                captcha.onSuccess(function () {
27                    var validateResult = captcha.getValidate();
28                    var request = pending;
29                    pending = null;
30
31                    if (!validateResult || !request) {
32                        captcha.reset();
33                        return;
34                    }
35
36                    validateResult.captcha_id = captchaId;
37                    request.onSuccess(validateResult, function () {
38                        captcha.reset();
39                    });
40                }).onError(function () {
41                    loadFailed = true;
42                    fail('图形验证加载失败,请稍后重试');
43                });
44            });
45        }
46
47        return {
48            show: function (onSuccess, onError) {
49                if (!captchaId) {
50                    onError('图形验证服务未配置,请联系管理员');
51                    return;
52                }
53                if (loadFailed || typeof window.initAlicom4 !== 'function') {
54                    onError('图形验证加载失败,请检查网络后重试');
55                    return;
56                }
57                if (!captcha) {
58                    onError('图形验证正在加载,请稍后重试');
59                    return;
60                }
61                if (pending) {
62                    onError('图形验证正在进行,请完成验证');
63                    return;
64                }
65
66                pending = {
67                    onSuccess: onSuccess,
68                    onError: onError
69                };
70                captcha.showCaptcha();
71            }
72        };
73    }
74
75    window.FtcbGraphAuthCaptcha = {
76        create: create
77    };
78})(window);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.