fix: 修复多个关键问题
- 修复前端路由守卫:未登录时不显示提示,直接跳转登录页 - 修复API拦截器:401错误不显示提示,直接跳转 - 增强验证码显示:图片尺寸从120x40增加到200x80 - 增大验证码字体:从28号增加到48号 - 优化验证码字符:排除易混淆的0和1 - 减少干扰线:从5条减少到3条,添加背景色优化 - 增强登录API日志:添加详细的调试日志 - 增强验证码生成和验证日志 - 优化异常处理和错误追踪 影响文件: - src/router/index.ts - src/api/request.ts - app/services/auth_service.py - app/api/v1/auth.py - app/schemas/user.py 测试状态: - 前端构建通过 - 后端语法检查通过 - 验证码显示效果优化完成 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
40
app/models/system_config.py
Normal file
40
app/models/system_config.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
系统配置数据模型
|
||||
"""
|
||||
from datetime import datetime
|
||||
from sqlalchemy import Column, BigInteger, String, Text, Integer, DateTime, Boolean, Index
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
from app.db.base import Base
|
||||
|
||||
|
||||
class SystemConfig(Base):
|
||||
"""系统配置表"""
|
||||
|
||||
__tablename__ = "system_configs"
|
||||
|
||||
id = Column(BigInteger, primary_key=True, index=True)
|
||||
config_key = Column(String(100), unique=True, nullable=False, index=True, comment="配置键")
|
||||
config_name = Column(String(200), nullable=False, comment="配置名称")
|
||||
config_value = Column(Text, nullable=True, comment="配置值")
|
||||
value_type = Column(String(20), default="string", nullable=False, comment="值类型: string/number/boolean/json")
|
||||
category = Column(String(50), nullable=False, index=True, comment="配置分类")
|
||||
description = Column(Text, nullable=True, comment="配置描述")
|
||||
is_system = Column(Boolean, default=False, nullable=False, comment="是否系统配置")
|
||||
is_encrypted = Column(Boolean, default=False, nullable=False, comment="是否加密存储")
|
||||
validation_rule = Column(Text, nullable=True, comment="验证规则(JSON)")
|
||||
options = Column(JSONB, nullable=True, comment="可选值配置")
|
||||
default_value = Column(Text, nullable=True, comment="默认值")
|
||||
sort_order = Column(Integer, default=0, nullable=False, comment="排序序号")
|
||||
is_active = Column(Boolean, default=True, nullable=False, comment="是否启用")
|
||||
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
||||
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)
|
||||
updated_by = Column(BigInteger, nullable=True, comment="更新人ID")
|
||||
|
||||
# 索引
|
||||
__table_args__ = (
|
||||
Index("idx_system_config_category", "category"),
|
||||
Index("idx_system_config_active", "is_active"),
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<SystemConfig(id={self.id}, config_key={self.config_key}, config_name={self.config_name})>"
|
||||
Reference in New Issue
Block a user