feat: redesign frontend UI with MoonShadow-style dark theme
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 8s

- Update color scheme to purple/blue gradient accents
- Add modern card layouts with hover effects
- Implement token display with copy button
- Add stats dashboard on home page
- Improve install page with SQLite/MySQL toggle
- Add feature cards for supported functions
- Improve login/register pages with centered layout
- Add admin page with user management table
- Add responsive grid layouts
- Add fade-in animations
This commit is contained in:
2026-07-17 01:48:01 +00:00
parent bd8db9ba27
commit 7bc8c74d5e
8 changed files with 1118 additions and 438 deletions
+37 -20
View File
@@ -1,9 +1,10 @@
import { useState } from 'react'
import { Link } from 'react-router-dom'
export default function RegisterPage() {
const [username, setUsername] = useState('')
const [password, setPassword] = useState('')
const [code, setCode] = useState('')
const [confirmPassword, setConfirmPassword] = useState('')
const [error, setError] = useState('')
const [success, setSuccess] = useState('')
const [loading, setLoading] = useState(false)
@@ -12,35 +13,50 @@ export default function RegisterPage() {
e.preventDefault()
setError('')
setSuccess('')
if (password !== confirmPassword) {
setError('两次密码不一致')
return
}
setLoading(true)
try {
const res = await fetch('/api/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password, registration_code: code }),
body: JSON.stringify({ username, password })
})
const data = await res.json()
if (!res.ok) {
if (res.ok) {
setSuccess('注册成功,请登录')
setTimeout(() => {
window.location.href = '/login'
}, 1500)
} else {
setError(data.error || '注册失败')
return
}
setSuccess('注册成功,请登录')
setTimeout(() => window.location.href = '/login', 2000)
} catch {
setError('网络错误')
setError('网络错误,请重试')
} finally {
setLoading(false)
}
}
return (
<div className="container" style={{ maxWidth: '400px', marginTop: '100px' }}>
<div className="card">
<h1 style={{ marginBottom: '24px', textAlign: 'center' }}></h1>
<div className="container-sm">
<div className="text-center mb-6" style={{ paddingTop: '80px' }}>
<div className="logo" style={{ width: '48px', height: '48px', fontSize: '20px', margin: '0 auto 16px' }}>
AC
</div>
<h1 className="page-title">AntiCaptcha</h1>
<p className="text-secondary"></p>
</div>
<div className="card fade-in">
<h2 className="text-lg mb-4 text-center"></h2>
<form onSubmit={handleSubmit}>
<div className="form-group">
@@ -68,27 +84,28 @@ export default function RegisterPage() {
</div>
<div className="form-group">
<label className="label"></label>
<label className="label"></label>
<input
type="text"
type="password"
className="input"
value={code}
onChange={e => setCode(e.target.value)}
placeholder="请输入注册码"
value={confirmPassword}
onChange={e => setConfirmPassword(e.target.value)}
placeholder="请再次输入密码"
required
/>
</div>
{error && <div className="error">{error}</div>}
{success && <div className="success">{success}</div>}
{error && <div className="error mb-4">{error}</div>}
{success && <div className="success mb-4">{success}</div>}
<button type="submit" className="button" style={{ width: '100%' }} disabled={loading}>
<button type="submit" className="button button-block button-lg" disabled={loading}>
{loading ? '注册中...' : '注册'}
</button>
</form>
<div className="text-center mt-4">
<a href="/login" style={{ color: 'var(--primary)' }}></a>
<span className="text-secondary"></span>{' '}
<Link to="/login"></Link>
</div>
</div>
</div>