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' }} + >《用户协议》 +
+
+ {/* 按钮 */}