feat: 添加用户登录认证功能,确保系统安全性,并提供修改密码和退出登录选项

This commit is contained in:
2026-03-14 00:11:16 +08:00
parent 847ec32144
commit d2d63d5e61
15 changed files with 437 additions and 5 deletions

View File

@@ -0,0 +1,50 @@
<!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/style.css') }}">
</head>
<body>
<header class="hero slim">
<div>
<h1>修改密码</h1>
<p>当前用户:{{ auth_username }}</p>
</div>
<div class="hero-actions">
<a class="btn btn-light" href="{{ url_for('types_page') }}">返回仓库概览</a>
<a class="btn btn-light" href="{{ url_for('logout_page') }}">退出登录</a>
</div>
</header>
<main class="container">
<section class="panel" style="max-width: 560px; margin: 0 auto;">
{% if error %}
<p class="alert">{{ error }}</p>
{% endif %}
{% if notice %}
<p class="notice">{{ notice }}</p>
{% endif %}
<form class="form-grid" method="post" action="{{ url_for('change_password_page') }}">
<label>
当前密码
<input type="password" name="current_password" required autocomplete="current-password" placeholder="请输入当前密码">
</label>
<label>
新密码至少8位
<input type="password" name="new_password" required minlength="8" autocomplete="new-password" placeholder="请输入新密码">
</label>
<label>
确认新密码
<input type="password" name="confirm_password" required minlength="8" autocomplete="new-password" placeholder="请再次输入新密码">
</label>
<div class="actions full">
<button class="btn" type="submit">保存新密码</button>
</div>
</form>
</section>
</main>
</body>
</html>