feat: optimize Token expiration monitor

This commit is contained in:
2026-01-03 17:02:28 +08:00
parent ed8019c14b
commit 523da50123
6 changed files with 335 additions and 8 deletions
+2
View File
@@ -16,6 +16,8 @@ class User(Base):
password_hash = Column(String(200), nullable=True, comment="密码哈希(bcrypt加密)")
authorization = Column(Text, nullable=True, comment="当前有效的 QQ Token")
jwt_exp = Column(String(20), default="0", comment="Token 过期时间戳")
token_expiring_notified = Column(Boolean, default=False, nullable=False, comment="Token 即将过期提醒是否已发送(过期前30分钟)")
token_expired_notified = Column(Boolean, default=False, nullable=False, comment="Token 已过期提醒是否已发送(过期后30分钟内)")
role = Column(String(20), default="user", index=True, comment="角色: user/admin")
is_approved = Column(Boolean, default=False, index=True, comment="是否已通过管理员审批")
created_at = Column(DateTime(timezone=True), server_default=func.now(), comment="创建时间")