

<!DOCTYPE html>

<html lang="zh">
<head>
    <title>人机验证 - 博客园</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="icon" id="favicon" href="https://assets.cnblogs.com/favicon_v3_2.ico" type="image/x-icon" />
    <script src="https://cdn-www.cnblogs.com/js/captcha.min.js?v=P7n6v50PZOucahcjhoZmXR845ffN38Wq6s-U-fMmXxg"></script>
    <style>
        .fixed-wrapper {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            row-gap: 24px;
        }

        .captcha-title {
            font-weight: bold;
            font-size: 24px;
        }

        .captcha-loading-overlay {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            row-gap: 12px;
        }
    </style>
</head>
<body class="fixed-wrapper">
    <h1 class="captcha-title">请完成人机验证</h1>
    <div id="loading-tip" style="display: none">正在加载验证码...</div>
    <button id="button" style="display: none" type="button"></button>
<script>
    var captcha = window.initCaptcha({
        bindTo: '#button',
        options: {
            providers: [5],
            frictionlessProviders: [0,2],
            aliyunCaptchaV2: {
                prefix: '1p4ezn',
                sceneId: `4q3maxds`,
                slideStyle: {
                    width: 360,
                    height: 50
                },
                type: 'embed',
                imageUrl: 'https://www.cnblogs.com/images/logo.svg'
            }
        },
        successCallback: function (res) {
            fetch('/ajax/captcha', {
                method: 'POST',
                body: JSON.stringify(res),
                headers: { 'Content-Type': 'application/json' }
            }).then(function () { location.reload(); });
        },
        executeOnReady: true,
        errorCallback: function () {
            document.getElementById('loading-tip').innerText = '验证码加载失败，请尝试刷新页面';
            document.getElementById('loading-tip').style.display = 'block';
        }
    });
</script>
</body>
</html>
  $"