From 796eeb36451fbd3251660568e24f384e00d4859e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=94=9F=E4=BA=A7?= Date: Wed, 18 Mar 2026 15:19:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=AE=A1=E7=90=86=20+=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/models/models.py | 1 + config/VERSION | 2 +- frontend/index.html | 2 +- frontend/src/pages/Admin.jsx | 127 ++++++++++++++++---------------- frontend/src/pages/Settings.jsx | 16 ++++ 5 files changed, 81 insertions(+), 67 deletions(-) diff --git a/backend/app/models/models.py b/backend/app/models/models.py index 1a3876c..6a3b975 100644 --- a/backend/app/models/models.py +++ b/backend/app/models/models.py @@ -25,6 +25,7 @@ class User(Base): bio = Column(Text, nullable=True) password = Column(String(255), nullable=False) role = Column(String(50), default="user") + last_login = Column(DateTime(timezone=True), nullable=True) # 最后登录时间 f99_92_created_at = Column(DateTime(timezone=True), server_default=func.now()) f99_93_updated_at = Column(DateTime(timezone=True), onupdate=func.now()) diff --git a/config/VERSION b/config/VERSION index a3dd670..1829e0f 100644 --- a/config/VERSION +++ b/config/VERSION @@ -2,7 +2,7 @@ # Version Configuration for Zodiac Collection Management System # 当前版本号 (语义化版本:主版本。次版本.修订版) -VERSION=1.1.13 +VERSION=1.1.15 # 版本代号 (可选) VERSION_CODENAME="新生" diff --git a/frontend/index.html b/frontend/index.html index f239b31..fcb2490 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - 甲辰收藏 v1.1.12 + 甲辰收藏 v1.1.14 diff --git a/frontend/src/pages/Admin.jsx b/frontend/src/pages/Admin.jsx index 3069572..91e16b0 100644 --- a/frontend/src/pages/Admin.jsx +++ b/frontend/src/pages/Admin.jsx @@ -182,74 +182,71 @@ export default function Admin() { -
- - - - - - - - - - - - {users.map((user, index) => ( - - - - - - - - ))} - -
用户名角色藏品数注册时间操作
{user.username} - + {users.map((user) => ( +
+
+
+
+
{user.username}
+
- {user.role} - -
{user.collection_count} - {new Date(user.created_at).toLocaleDateString('zh-CN')} - -
- - {user.role !== 'admin' && ( - - )} + {user.role === 'admin' ? '👑 管理员' : '👤 用户'}
-
+
+
+ 📧 {user.email || '未设置'} | 📱 {user.phone || '未设置'} +
+ +
+
藏品数
+
{user.collection_count || 0}
+
+ +
+
+ 注册时间:{user.created_at ? new Date(user.created_at).toLocaleDateString('zh-CN') : '-'} +
+
+ + {user.role !== 'admin' && ( + + )} +
+
+ + ))} {users.length === 0 && ( diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx index e029a8d..7cfd146 100644 --- a/frontend/src/pages/Settings.jsx +++ b/frontend/src/pages/Settings.jsx @@ -11,6 +11,8 @@ export default function Settings() { username: '', email: '', phone: '', + avatar: '', + address: '', bio: '' }) @@ -39,6 +41,8 @@ export default function Settings() { username: data.username || '', email: data.email || '', phone: data.phone || '', + avatar: data.avatar || '', + address: data.address || '', bio: data.bio || '' }) } else { @@ -55,6 +59,8 @@ export default function Settings() { username: user.username || '', email: user.email || '', phone: user.phone || '', + avatar: user.avatar || '', + address: user.address || '', bio: user.bio || '' }) } catch (e2) { @@ -213,6 +219,16 @@ export default function Settings() { /> +
+ + setForm({ ...form, address: e.target.value })} + style={{ width: '100%', padding: '12px', borderRadius: '8px', border: '1px solid #334155', background: '#0f172a', color: '#fff' }} + /> +
+