实例:通过前台和后台,实现用户登录页面动态图片验证码校验,图片验证码部分使用Pillow模块实现,作为单独学习部分记录。

前端:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>login</title>
    <link rel="stylesheet" href="/static/commons.css" />
</head>
<body>
<div>
    <div>用户登录</div>
    <form>
        <div>
            <label>用户名</label>
            <input type="text" placeholder="请输入用户名" />
        </div>
        <div>
            <label>密码</label>
            <input type="text" placeholder="请输入密码" />
        </div>
        <div>
            <label>验证码</label>
            <div>
                <input type="text" placeholder="输入验证码" name="check_code">
            </div>
            <div>
                <img src="/app04/check_code.html" onclick="changeCheckCode(this);">
            </div>
        </div>
    </form>
</div>
<script>
    function changeCheckCode(ths) {
{#        可以简单实现验证码刷新#}
        ths.src = ths.src + '?'
    }
</script>
</body>
</html>
View Code

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2021-10-14
  • 2021-08-31
  • 2022-12-23
  • 2021-11-11
  • 2022-01-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-11
  • 2021-06-18
  • 2021-08-04
  • 2021-08-08
  • 2022-12-23
相关资源
相似解决方案