feat(登录): 添加忘记密码功能
- 新增忘记密码页面及路由配置 - 在登录页面添加忘记密码链接 - 添加中英文国际化支持 - 优化邮件管理页面的响应式布局
This commit is contained in:
1 parent
ba480a3f9c
commit
a4e436a42d
6 files changed
+271
-11
No files matched your search
@@ -266,7 +266,13 @@ export default {
|
||||
title: 'Login',
|
||||
success: 'Login successful',
|
||||
failed: 'Login failed',
|
||||
subtitle: 'Welcome back, please login to your account.'
|
||||
subtitle: 'Welcome back, please login to your account.',
|
||||
forgotPassword: 'Forgot Password?'
|
||||
},
|
||||
forgotPassword: {
|
||||
title: 'Forgot Password',
|
||||
message: 'Please contact the administrator to reset your password',
|
||||
backToLogin: 'Back to Login'
|
||||
},
|
||||
admin: {
|
||||
dataEntries: 'Data Entries',
|
||||
|
||||
@@ -278,7 +278,13 @@ export default {
|
||||
title: '登录',
|
||||
success: '登录成功',
|
||||
failed: '登录失败',
|
||||
subtitle: '欢迎回来,请登录您的账户。'
|
||||
subtitle: '欢迎回来,请登录您的账户。',
|
||||
forgotPassword: '忘记密码?'
|
||||
},
|
||||
forgotPassword: {
|
||||
title: '忘记密码',
|
||||
message: '请联系管理员重置密码',
|
||||
backToLogin: '返回登录'
|
||||
},
|
||||
admin: {
|
||||
dataEntries: '数据条目',
|
||||
|
||||
@@ -7,6 +7,11 @@ const routes = [
|
||||
name: 'Login',
|
||||
component: () => import('../views/Login.vue')
|
||||
},
|
||||
{
|
||||
path: '/forgot-password',
|
||||
name: 'ForgotPassword',
|
||||
component: () => import('../views/ForgotPassword.vue')
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/dashboard',
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<div class="forgot-password-page">
|
||||
<div class="forgot-password-background">
|
||||
<div class="bg-gradient"></div>
|
||||
<div class="bg-grid"></div>
|
||||
<div class="bg-glow"></div>
|
||||
</div>
|
||||
|
||||
<transition name="scale-fade" appear>
|
||||
<el-card class="forgot-password-card" shadow="never">
|
||||
<div class="forgot-password-header">
|
||||
<div class="forgot-password-icon">
|
||||
<el-icon :size="48"><Key /></el-icon>
|
||||
</div>
|
||||
<h1 class="forgot-password-title">{{ $t('forgotPassword.title') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="forgot-password-content">
|
||||
<p class="forgot-password-message">
|
||||
{{ $t('forgotPassword.message') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="forgot-password-actions">
|
||||
<router-link to="/login">
|
||||
<el-button type="primary" class="back-to-login-button">
|
||||
{{ $t('forgotPassword.backToLogin') }}
|
||||
</el-button>
|
||||
</router-link>
|
||||
</div>
|
||||
</el-card>
|
||||
</transition>
|
||||
|
||||
<div class="forgot-password-footer">
|
||||
<span>RCT System v1.0</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Key } from '@element-plus/icons-vue'
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.forgot-password-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: var(--space-6);
|
||||
}
|
||||
|
||||
/* ========== Background Effects ========== */
|
||||
.forgot-password-background {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bg-gradient {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.bg-grid {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image:
|
||||
linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
|
||||
background-size: 60px 60px;
|
||||
}
|
||||
|
||||
.bg-glow {
|
||||
position: absolute;
|
||||
top: 20%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* ========== Forgot Password Card ========== */
|
||||
.forgot-password-card {
|
||||
width: 420px;
|
||||
max-width: 90%;
|
||||
border-radius: var(--radius-2xl);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(20px);
|
||||
box-shadow:
|
||||
0 25px 50px -12px rgba(0, 0, 0, 0.25),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.1) inset;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
animation: slideUp 0.6s var(--ease-out-expo);
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: var(--space-8);
|
||||
}
|
||||
|
||||
/* ========== Forgot Password Header ========== */
|
||||
.forgot-password-header {
|
||||
text-align: center;
|
||||
margin-bottom: var(--space-6);
|
||||
}
|
||||
|
||||
.forgot-password-icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: var(--space-4);
|
||||
color: var(--color-primary-600);
|
||||
}
|
||||
|
||||
.forgot-password-title {
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--text-2xl);
|
||||
font-weight: var(--font-bold);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ========== Content Styles ========== */
|
||||
.forgot-password-content {
|
||||
text-align: center;
|
||||
margin-bottom: var(--space-6);
|
||||
}
|
||||
|
||||
.forgot-password-message {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-base);
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ========== Actions ========== */
|
||||
.forgot-password-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.back-to-login-button {
|
||||
min-width: 160px;
|
||||
height: 44px;
|
||||
font-size: var(--text-base);
|
||||
font-weight: var(--font-semibold);
|
||||
border-radius: var(--radius-lg) !important;
|
||||
background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700)) !important;
|
||||
border: none !important;
|
||||
box-shadow:
|
||||
0 4px 14px rgba(59, 130, 246, 0.4),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.1) inset;
|
||||
transition: all var(--transition-base) var(--ease-out-expo);
|
||||
}
|
||||
|
||||
.back-to-login-button:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow:
|
||||
0 8px 20px rgba(59, 130, 246, 0.5),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
|
||||
}
|
||||
|
||||
.back-to-login-button:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* ========== Scale Fade Animation ========== */
|
||||
.scale-fade-enter-active {
|
||||
transition: all 0.6s var(--ease-out-expo);
|
||||
}
|
||||
|
||||
.scale-fade-enter-from {
|
||||
opacity: 0;
|
||||
transform: scale(0.95) translateY(10px);
|
||||
}
|
||||
|
||||
/* ========== Forgot Password Footer ========== */
|
||||
.forgot-password-footer {
|
||||
position: absolute;
|
||||
bottom: var(--space-6);
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
font-size: var(--text-xs);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* ========== Mobile Responsive ========== */
|
||||
@media screen and (max-width: 768px) {
|
||||
.forgot-password-page {
|
||||
padding: var(--space-4);
|
||||
}
|
||||
|
||||
.forgot-password-card {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: var(--space-6);
|
||||
}
|
||||
|
||||
.forgot-password-title {
|
||||
font-size: var(--text-xl);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -58,6 +58,12 @@
|
||||
<span v-else>{{ $t('common.loading') }}</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<div class="forgot-password">
|
||||
<router-link to="/forgot-password" class="forgot-link">
|
||||
{{ $t('login.forgotPassword') }}
|
||||
</router-link>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</transition>
|
||||
@@ -318,6 +324,23 @@ const handleLogin = async () => {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* ========== Forgot Password ========== */
|
||||
.forgot-password {
|
||||
text-align: center;
|
||||
margin-top: var(--space-4);
|
||||
}
|
||||
|
||||
.forgot-link {
|
||||
color: var(--color-text-tertiary);
|
||||
font-size: var(--text-sm);
|
||||
text-decoration: none;
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
|
||||
.forgot-link:hover {
|
||||
color: var(--color-primary-600);
|
||||
}
|
||||
|
||||
/* ========== Scale Fade Animation ========== */
|
||||
.scale-fade-enter-active {
|
||||
transition: all 0.6s var(--ease-out-expo);
|
||||
|
||||
@@ -488,10 +488,10 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.management-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 400px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
max-width: 1400px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
@@ -587,12 +587,6 @@ onMounted(() => {
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.management-content {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.email-management {
|
||||
padding: 12px;
|
||||
|
||||
Reference in new issue
Block a user