首次完成数据库登录,注册验证。首次完成,migrate_manager.py迁移多个数据库
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>后台管理系统 - 管理员登录</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/admin.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<main class="admin-card">
|
||||
<header class="admin-header">
|
||||
<div class="shield-badge" aria-hidden="true">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 2 4 5v6c0 5.25 3.4 10.15 8 11 4.6-.85 8-5.75 8-11V5l-8-3zm-1 14.5-3.5-3.5 1.41-1.41L11 13.67l4.59-4.58L17 10.5l-6 6z"/></svg>
|
||||
</div>
|
||||
<h1>后台管理系统</h1>
|
||||
<p class="subtitle">ADMIN CONSOLE</p>
|
||||
</header>
|
||||
|
||||
<div id="errorBox" class="error-msg" role="alert"></div>
|
||||
|
||||
<form id="adminLoginForm" method="post" action="/admin/login" novalidate>
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<div class="input-wrap">
|
||||
<input type="text" id="username" name="username"
|
||||
placeholder="请输入管理员用户名"
|
||||
autocomplete="username" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<div class="input-wrap">
|
||||
<input type="password" id="password" name="password"
|
||||
placeholder="请输入密码(至少 6 位)"
|
||||
autocomplete="current-password" required
|
||||
minlength="6">
|
||||
<button type="button" class="toggle-pwd" id="togglePwd" aria-label="切换密码可见性">
|
||||
<svg id="eyeIcon" viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 12.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-8a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<p class="capslock-hint" id="capslockHint">提示:大写锁定(Caps Lock)已开启</p>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn" id="submitBtn" data-primary-action>登 录</button>
|
||||
</form>
|
||||
|
||||
<section class="success-panel" id="successPanel">
|
||||
<div class="check-icon">
|
||||
<svg viewBox="0 0 24 24"><polyline points="4 12.5 9.5 18 20 6.5"/></svg>
|
||||
</div>
|
||||
<h2>登录成功</h2>
|
||||
<p>欢迎,<span id="welcomeName">管理员</span>!<br>本页面为前端登录演示,未连接真实账号系统。</p>
|
||||
<button type="button" class="back-btn" id="backBtn">返回登录</button>
|
||||
</section>
|
||||
|
||||
<p class="demo-tip">演示提示:输入任意用户名和 6 位以上密码即可体验完整登录流程。<br>接入真实后端时,将表单 action 替换为实际登录接口地址,并移除脚本中的演示拦截逻辑即可。</p>
|
||||
</main>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/admin.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>关于我 | About Me</title>
|
||||
<!-- 引入 GitHub 风格的图标库 (Octicons) -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown-light.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/@primer/octicons/19.8.0/octicons.min.css">
|
||||
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<!-- 模拟头像 -->
|
||||
<div class="avatar">
|
||||
<!-- 使用 Octicon 中的 MarkGithub 图标 -->
|
||||
<svg aria-hidden="true" height="48" viewBox="0 0 16 16" version="1.1" width="48" data-view-component="true" class="octicon octicon-mark-github">
|
||||
<path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<h1>关于作者</h1>
|
||||
|
||||
<!-- 按钮链接 -->
|
||||
<a href="https://www.github.com" target="_blank" class="btn btn-github">
|
||||
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon">
|
||||
<path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path>
|
||||
</svg>
|
||||
GitHub Profile
|
||||
</a>
|
||||
|
||||
<a href="mailto:yourname@example.com" class="btn btn-email">
|
||||
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-mail">
|
||||
<path d="M1.75 2A1.75 1.75 0 0 0 0 3.75v.736c0 .14.068.271.182.352l7.061 4.967a1.75 1.75 0 0 0 2.014 0l7.061-4.967A.438.438 0 0 0 16.5 4.486V3.75A1.75 1.75 0 0 0 14.75 2H1.75Zm13 3.384-6.47 4.544a.25.25 0 0 1-.288 0L1.5 5.385v2.865A1.75 1.75 0 0 0 3.25 10h10a1.75 1.75 0 0 0 1.75-1.75V5.384Z"></path>
|
||||
</svg>
|
||||
发送邮件
|
||||
</a>
|
||||
|
||||
<!-- 创作经历内容 -->
|
||||
<div class="content">
|
||||
<h3>创作经历</h3>
|
||||
<p>
|
||||
我是一名热爱开源的开发者,长期活跃于 GitHub 社区。
|
||||
在这里,我分享我的代码片段、开源项目以及技术学习笔记。
|
||||
我相信代码可以改变世界,也希望通过我的项目能为社区带来一些微小的价值。
|
||||
</p>
|
||||
<p>
|
||||
<strong>主要技术栈:</strong> Python, Flask, HTML/CSS, JavaScript
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
Index
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>用户登录</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<main class="login-card">
|
||||
<h1>欢迎登录</h1>
|
||||
<p class="subtitle">请输入您的账号信息</p>
|
||||
|
||||
<div id="errorBox" class="error-msg" role="alert"></div>
|
||||
|
||||
<form id="loginForm" method="post" action="/login" novalidate>
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" id="username" name="username"
|
||||
placeholder="请输入用户名"
|
||||
autocomplete="username" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<input type="password" id="password" name="password"
|
||||
placeholder="请输入密码"
|
||||
autocomplete="current-password" required
|
||||
minlength="6">
|
||||
</div>
|
||||
|
||||
<div class="form-options">
|
||||
<label>
|
||||
<input type="checkbox" name="remember"> 记住我
|
||||
</label>
|
||||
<a href="/forgot-password">忘记密码?</a>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn">登 录</button>
|
||||
</form>
|
||||
|
||||
<p class="register-link">还没有账号?<a href="/register">立即注册</a></p>
|
||||
</main>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/login.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>个人主页</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>用户注册</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/register.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<main class="register-card">
|
||||
<h1>创建账号</h1>
|
||||
<p class="subtitle">填写以下信息完成注册</p>
|
||||
|
||||
<div id="errorBox" class="error-msg" role="alert"></div>
|
||||
|
||||
<form id="registerForm" method="post" action="/register" novalidate>
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" id="username" name="username"
|
||||
placeholder="3-20 个字符"
|
||||
autocomplete="username" required
|
||||
minlength="3" maxlength="20">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">邮箱</label>
|
||||
<input type="email" id="email" name="email"
|
||||
placeholder="请输入邮箱地址"
|
||||
autocomplete="email" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<input type="password" id="password" name="password"
|
||||
placeholder="至少 6 位"
|
||||
autocomplete="new-password" required
|
||||
minlength="6">
|
||||
<p class="hint">建议使用字母、数字和符号的组合,提高安全性</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="confirmPassword">确认密码</label>
|
||||
<input type="password" id="confirmPassword" name="confirmPassword"
|
||||
placeholder="请再次输入密码"
|
||||
autocomplete="new-password" required
|
||||
minlength="6">
|
||||
</div>
|
||||
|
||||
<label class="agreement">
|
||||
<input type="checkbox" id="agree" name="agree" required>
|
||||
<span>我已阅读并同意 <a href="/terms">服务条款</a> 和 <a href="/privacy">隐私政策</a></span>
|
||||
</label>
|
||||
|
||||
<button type="submit" class="submit-btn">注 册</button>
|
||||
</form>
|
||||
|
||||
<p class="login-link">已有账号?<a href="/login">去登录</a></p>
|
||||
</main>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/register.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user