From 617f1401e7795f4cbf59bbf070bcec952bea6b4e Mon Sep 17 00:00:00 2001 From: longda Date: Fri, 20 Mar 2026 17:29:26 +0800 Subject: [PATCH] =?UTF-8?q?v1.2.1=20=E7=94=A8=E6=88=B7=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20-=20=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=8B=BE=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 2 +- frontend/src/pages/Login.jsx | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 8a47fdb..767c9e5 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - 甲辰收藏 v1.2.0 + 甲辰收藏 v1.2.1 diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index 58549f7..47f3198 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -12,7 +12,7 @@ export default function Login() { // 注册相关状态 const [showRegister, setShowRegister] = useState(false) - const [registerData, setRegisterData] = useState({ + const [registerData, setRegisterData] = useState({ agreeTerms: false, username: '', password: '', confirmPassword: '', @@ -97,6 +97,11 @@ export default function Login() { return } + if (!registerData.agreeTerms) { + setRegisterError('请先同意用户协议') + return + } + if (registerData.username.length < 2) { setRegisterError('用户名至少 2 个字符') return @@ -250,7 +255,6 @@ export default function Login() { background: '#fff' }} /> -

甲辰收藏

生肖纪念钞管理系统

@@ -599,6 +603,24 @@ export default function Login() { /> + + {/* 用户协议勾选 */} +
+ setRegisterData(prev => ({ ...prev, agreeTerms: e.target.checked }))} + style={{ width: '18px', height: '18px', marginTop: '2px', cursor: 'pointer' }} + /> +
+ 我已阅读并同意 + window.open('/user_agreement.html', '_blank')} + style={{ color: '#fbbf24', cursor: 'pointer', textDecoration: 'underline' }} + >《用户协议》 +
+
+ {/* 按钮 */}