Initial commit: DVS Cloud Drive v1.0.0
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}修改密码 - DVS云盘{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="max-w-lg mx-auto">
|
||||
<div class="mac-card">
|
||||
<div class="mac-card-header">
|
||||
<div class="flex items-center">
|
||||
<i class="fas fa-key mr-3"></i>
|
||||
<h5 class="mb-0">修改密码</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="mac-alert mac-alert-{{ 'success' if category == 'success' else 'info' if category == 'info' else 'warning' if category == 'warning' else 'danger' }} mb-6">
|
||||
<i class="fas fa-{{ 'check-circle' if category == 'success' else 'info-circle' if category == 'info' else 'exclamation-triangle' if category == 'warning' else 'times-circle' }}"></i>
|
||||
<span>{{ message|safe }}</span>
|
||||
<button type="button" class="mac-action-btn ml-auto" onclick="this.parentElement.remove()">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<form method="POST" action="{{ url_for('change_password') }}">
|
||||
<div class="mb-6">
|
||||
<label for="current_password" class="block text-gray-700 mb-2 font-medium">
|
||||
<i class="fas fa-lock mr-2"></i>当前密码
|
||||
</label>
|
||||
<input type="password" class="mac-input w-full" id="current_password" name="current_password" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label for="new_password" class="block text-gray-700 mb-2 font-medium">
|
||||
<i class="fas fa-key mr-2"></i>新密码
|
||||
</label>
|
||||
<input type="password" class="mac-input w-full" id="new_password" name="new_password" required>
|
||||
<div class="text-gray-500 text-sm mt-2">密码长度至少6个字符</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-8">
|
||||
<label for="confirm_password" class="block text-gray-700 mb-2 font-medium">
|
||||
<i class="fas fa-lock mr-2"></i>确认新密码
|
||||
</label>
|
||||
<input type="password" class="mac-input w-full" id="confirm_password" name="confirm_password" required>
|
||||
<div class="text-gray-500 text-sm mt-2">请再次输入新密码以确保一致性</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between gap-3">
|
||||
<a href="{{ url_for('index') }}" class="mac-btn mac-btn-secondary">
|
||||
<i class="fas fa-arrow-left mr-2"></i>返回
|
||||
</a>
|
||||
<button type="submit" class="mac-btn mac-btn-primary">
|
||||
<i class="fas fa-save mr-2"></i>保存更改
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 密码确认验证
|
||||
const newPassword = document.getElementById('new_password');
|
||||
const confirmPassword = document.getElementById('confirm_password');
|
||||
|
||||
function validatePassword() {
|
||||
if (newPassword.value !== confirmPassword.value) {
|
||||
confirmPassword.setCustomValidity('两次输入的密码不一致');
|
||||
} else {
|
||||
confirmPassword.setCustomValidity('');
|
||||
}
|
||||
}
|
||||
|
||||
newPassword.addEventListener('change', validatePassword);
|
||||
confirmPassword.addEventListener('keyup', validatePassword);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user