Skip to content

page #1

@haodahao11

Description

@haodahao11
<title>查询验证码</title> <style> body { font-family: Arial, sans-serif; } .container { max-width: 400px; margin: 50px auto; text-align: center; } input[type="text"] { padding: 10px; width: 100%; margin: 10px 0; } button { padding: 10px 20px; cursor: pointer; } .result { margin-top: 20px; } </style>

查询验证码

查询验证码
<script> // 设置Worker URL const WORKER_URL = "https://your-worker-subdomain.pages.dev"; // 请替换为实际的 Worker URL async function getVerificationCode() { const email = document.getElementById('email').value.trim(); if (!email) { alert("请输入邮箱地址"); return; } try { // 从后台获取JWT const response = await fetch(`${WORKER_URL}/get-jwt?email=${email}`, { method: 'GET' }); const data = await response.json(); if (!data.jwt) { alert("无法获取JWT,请检查邮箱地址或后台设置"); return; } // 查询验证码 const res = await fetch(WORKER_URL, { method: 'GET', headers: { "Authorization": `Bearer ${data.jwt}`, "Content-Type": "application/json" } }); const result = await res.json(); if (result.success) { document.getElementById('result').innerHTML = `验证码: ${result.verificationCode}`; } else { document.getElementById('result').innerHTML = `错误: ${result.message}`; } } catch (error) { alert("查询失败,请重试!"); console.error(error); } } </script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions