<!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 href="/static/css/all.min.css" rel="stylesheet">
|
<style>
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
body {
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
background: #f0f2f5;
|
color: #1a1a2e;
|
min-height: 100vh;
|
}
|
.header {
|
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
color: white;
|
padding: 24px 32px;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
flex-wrap: wrap;
|
gap: 12px;
|
}
|
.header h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
|
.header .nav-links {
|
display: flex; gap: 8px; align-items: center;
|
}
|
.header .nav-links a {
|
color: rgba(255,255,255,0.8);
|
text-decoration: none;
|
font-size: 14px;
|
padding: 6px 14px;
|
border-radius: 8px;
|
border: 1px solid rgba(255,255,255,0.2);
|
transition: all 0.2s;
|
}
|
.header .nav-links a:hover {
|
background: rgba(255,255,255,0.1);
|
color: white;
|
}
|
.container { max-width: 520px; margin: 40px auto; padding: 0 20px; }
|
|
.card {
|
background: white;
|
border-radius: 16px;
|
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
overflow: hidden;
|
}
|
.card .card-header {
|
padding: 20px 24px;
|
border-bottom: 1px solid #eef0f4;
|
}
|
.card .card-header h2 {
|
font-size: 16px;
|
display: flex; align-items: center; gap: 8px;
|
}
|
.card .card-body { padding: 24px; }
|
|
.form-group { margin-bottom: 20px; }
|
.form-group label {
|
display: block;
|
font-size: 14px;
|
font-weight: 500;
|
color: #374151;
|
margin-bottom: 6px;
|
}
|
.form-group .input-wrap {
|
position: relative;
|
}
|
.form-group .input-wrap i {
|
position: absolute;
|
left: 14px;
|
top: 50%;
|
transform: translateY(-50%);
|
color: #9ca3af;
|
}
|
.form-group input {
|
width: 100%;
|
padding: 11px 14px 11px 42px;
|
border: 1px solid #d1d5db;
|
border-radius: 10px;
|
font-size: 15px;
|
outline: none;
|
transition: border-color 0.2s;
|
}
|
.form-group input:focus {
|
border-color: #2563eb;
|
box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
|
}
|
|
.msg {
|
padding: 10px 14px;
|
border-radius: 8px;
|
font-size: 13px;
|
margin-bottom: 20px;
|
display: none;
|
align-items: center;
|
gap: 8px;
|
}
|
.msg.show { display: flex; }
|
.msg.success {
|
background: #ecfdf5;
|
border: 1px solid #6ee7b7;
|
color: #059669;
|
}
|
.msg.error {
|
background: #fef2f2;
|
border: 1px solid #fca5a5;
|
color: #dc2626;
|
}
|
|
.btn-submit {
|
width: 100%;
|
padding: 12px;
|
background: #2563eb;
|
color: white;
|
border: none;
|
border-radius: 10px;
|
font-size: 16px;
|
font-weight: 500;
|
cursor: pointer;
|
transition: background 0.2s;
|
}
|
.btn-submit:hover { background: #1d4ed8; }
|
</style>
|
</head>
|
<body>
|
|
<div class="header">
|
<h1><i class="fa-solid fa-key"></i> 修改密码</h1>
|
<div class="nav-links">
|
<a href="/"><i class="fa-solid fa-arrow-left"></i> 返回后台</a>
|
<a href="/logout"><i class="fa-solid fa-arrow-right-from-bracket"></i> 退出</a>
|
</div>
|
</div>
|
|
<div class="container">
|
<div class="card">
|
<div class="card-header">
|
<h2><i class="fa-solid fa-lock"></i> 修改登录密码 — <span style="color:#2563eb;font-size:14px;"><%= user.username %></span></h2>
|
</div>
|
<div class="card-body">
|
<% if (success) { %>
|
<div class="msg success show">
|
<i class="fa-regular fa-circle-check"></i>
|
<span><%= success %></span>
|
</div>
|
<% } %>
|
<% if (error) { %>
|
<div class="msg error show">
|
<i class="fa-solid fa-circle-exclamation"></i>
|
<span><%= error %></span>
|
</div>
|
<% } %>
|
|
<form method="POST" action="/api/change-password">
|
<div class="form-group">
|
<label>当前密码</label>
|
<div class="input-wrap">
|
<i class="fa-solid fa-lock"></i>
|
<input type="password" name="oldPassword" placeholder="输入当前密码" required>
|
</div>
|
</div>
|
<div class="form-group">
|
<label>新密码</label>
|
<div class="input-wrap">
|
<i class="fa-solid fa-key"></i>
|
<input type="password" name="newPassword" placeholder="至少 6 位" minlength="6" required>
|
</div>
|
</div>
|
<div class="form-group">
|
<label>确认新密码</label>
|
<div class="input-wrap">
|
<i class="fa-solid fa-key"></i>
|
<input type="password" name="confirmPassword" placeholder="再次输入新密码" minlength="6" required>
|
</div>
|
</div>
|
<button type="submit" class="btn-submit">
|
<i class="fa-regular fa-floppy-disk"></i> 保存修改
|
</button>
|
</form>
|
</div>
|
</div>
|
</div>
|
|
</body>
|
</html>
|