From 08eab43034e0247b967d23fe74dd04db953b52eb Mon Sep 17 00:00:00 2001 From: mzl Date: Mon, 27 Apr 2026 10:21:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E7=B3=BB=E7=BB=9F=E7=BB=B4=E6=8A=A4=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=8C=E6=9A=82=E6=97=B6=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- frontend/src/i18n/locales/en.json | 7 ++++- frontend/src/i18n/locales/es.json | 7 ++++- frontend/src/i18n/locales/fr.json | 7 ++++- frontend/src/i18n/locales/ru.json | 7 ++++- frontend/src/i18n/locales/zh.json | 7 ++++- frontend/src/pages/login-simple/index.tsx | 19 ++++++++++++ frontend/src/pages/login/index.tsx | 18 +++++++++++ frontend/src/pages/login/login.module.css | 37 +++++++++++++++++++++++ 8 files changed, 104 insertions(+), 5 deletions(-) diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 88cb16d..3fc7b8a 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -186,5 +186,10 @@ "lastMonth": "Last Month", "thisYear": "This Year", "lastYear": "Last Year" + }, + "maintenance": { + "title": "System Upgrade", + "message": "The system is under maintenance. Expected to resume at 23:59 tonight. Please wait patiently.", + "estimatedTime": "Estimated recovery: 23:59 tonight" } -} +} \ No newline at end of file diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json index d8fcaf7..c6c3f8c 100644 --- a/frontend/src/i18n/locales/es.json +++ b/frontend/src/i18n/locales/es.json @@ -161,5 +161,10 @@ "lastMonth": "Mes Pasado", "thisYear": "Este Año", "lastYear": "Año Pasado" + }, + "maintenance": { + "title": "Actualización del sistema", + "message": "El sistema está en mantenimiento. Se espera que se reanude a las 23:59 de esta noche. Por favor, espere pacientemente.", + "estimatedTime": "Hora estimada de recuperación: 23:59 esta noche" } -} +} \ No newline at end of file diff --git a/frontend/src/i18n/locales/fr.json b/frontend/src/i18n/locales/fr.json index 0922bdd..9cea65a 100644 --- a/frontend/src/i18n/locales/fr.json +++ b/frontend/src/i18n/locales/fr.json @@ -161,5 +161,10 @@ "lastMonth": "Mois Dernier", "thisYear": "Cette Année", "lastYear": "Année Dernière" + }, + "maintenance": { + "title": "Mise à jour du système", + "message": "Le système est en maintenance. Reprise prévue à 23h59 ce soir. Veuillez patienter.", + "estimatedTime": "Heure de reprise estimée : 23h59 ce soir" } -} +} \ No newline at end of file diff --git a/frontend/src/i18n/locales/ru.json b/frontend/src/i18n/locales/ru.json index 206daa5..9d34ee0 100644 --- a/frontend/src/i18n/locales/ru.json +++ b/frontend/src/i18n/locales/ru.json @@ -161,5 +161,10 @@ "lastMonth": "В прошлом месяце", "thisYear": "В этом году", "lastYear": "В прошлом году" + }, + "maintenance": { + "title": "Обновление системы", + "message": "Система находится на техническом обслуживании. Ожидаемое восстановление в 23:59 сегодня. Пожалуйста, подождите.", + "estimatedTime": "Ожидаемое восстановление: сегодня 23:59" } -} +} \ No newline at end of file diff --git a/frontend/src/i18n/locales/zh.json b/frontend/src/i18n/locales/zh.json index 9209488..ae5c709 100644 --- a/frontend/src/i18n/locales/zh.json +++ b/frontend/src/i18n/locales/zh.json @@ -186,5 +186,10 @@ "lastMonth": "上月", "thisYear": "今年", "lastYear": "去年" + }, + "maintenance": { + "title": "系统升级中", + "message": "系统维护升级中,预计今晚 23:59 恢复,请耐心等待", + "estimatedTime": "预计恢复时间:今晚 23:59" } -} +} \ No newline at end of file diff --git a/frontend/src/pages/login-simple/index.tsx b/frontend/src/pages/login-simple/index.tsx index aea3ba6..ca7115d 100644 --- a/frontend/src/pages/login-simple/index.tsx +++ b/frontend/src/pages/login-simple/index.tsx @@ -1,16 +1,35 @@ import { useState } from 'react' import { useNavigate } from 'react-router-dom' import { Button, Input, Toast } from 'antd-mobile' +import { useTranslation } from 'react-i18next' import { useUserStore } from '@/stores/user' +import loginStyles from '../login/login.module.css' import styles from './login-simple.module.css' +// 维护模式开关 - 恢复时改为 false 重新部署即可 +const MAINTENANCE_MODE = true + export default function SimpleLogin() { + const { t } = useTranslation() const navigate = useNavigate() const { login } = useUserStore() const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [loading, setLoading] = useState(false) + if (MAINTENANCE_MODE) { + return ( +
+
+
🔧
+

{t('maintenance.title')}

+

{t('maintenance.message')}

+

{t('maintenance.estimatedTime')}

+
+
+ ) + } + const handleLogin = async () => { if (!username || !password) { Toast.show('请输入用户名和密码') diff --git a/frontend/src/pages/login/index.tsx b/frontend/src/pages/login/index.tsx index f84827d..ac3a2fa 100644 --- a/frontend/src/pages/login/index.tsx +++ b/frontend/src/pages/login/index.tsx @@ -1,10 +1,14 @@ import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' import { Toast } from 'antd-mobile' +import { useTranslation } from 'react-i18next' import { useUserStore } from '@/stores/user' import QRCodeLogin from './QRCodeLogin' import styles from './login.module.css' +// 维护模式开关 - 恢复时改为 false 重新部署即可 +const MAINTENANCE_MODE = true + // 声明飞书 JSAPI 类型 declare global { interface Window { @@ -16,6 +20,7 @@ declare global { } export default function Login() { + const { t } = useTranslation() const navigate = useNavigate() const { login } = useUserStore() const [loading, setLoading] = useState(true) @@ -23,6 +28,19 @@ export default function Login() { const [showQRCode, setShowQRCode] = useState(false) const [shouldSkipAutoLogin, setShouldSkipAutoLogin] = useState(false) // 防止重复执行免登 + if (MAINTENANCE_MODE) { + return ( +
+
+
🔧
+

{t('maintenance.title')}

+

{t('maintenance.message')}

+

{t('maintenance.estimatedTime')}

+
+
+ ) + } + // 检查登录状态 useEffect(() => { const urlParams = new URLSearchParams(window.location.search) diff --git a/frontend/src/pages/login/login.module.css b/frontend/src/pages/login/login.module.css index 04b470d..3d26255 100644 --- a/frontend/src/pages/login/login.module.css +++ b/frontend/src/pages/login/login.module.css @@ -102,3 +102,40 @@ transform: rotate(360deg); } } + +.maintenanceContainer { + text-align: center; + padding: 40px 30px; + max-width: 360px; +} + +.maintenanceIcon { + font-size: 64px; + margin-bottom: 24px; + animation: bounce 2s ease-in-out infinite; +} + +.maintenanceTitle { + color: #fff; + font-size: 24px; + font-weight: 600; + margin: 0 0 16px 0; +} + +.maintenanceMessage { + color: rgba(255, 255, 255, 0.9); + font-size: 16px; + line-height: 1.6; + margin: 0 0 12px 0; +} + +.maintenanceTime { + color: rgba(255, 255, 255, 0.7); + font-size: 14px; + margin: 0; +} + +@keyframes bounce { + 0%, 100% { transform: translateY(0); } + 50% { transform: translateY(-10px); } +}