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:
Claude
2026-01-25 00:26:21 +08:00
commit e71181f0a3
150 changed files with 39549 additions and 0 deletions

60
Makefile Normal file
View File

@@ -0,0 +1,60 @@
.PHONY: help install run test clean format lint db-migrate db-upgrade db-downgrade
# 默认目标
help:
@echo "可用命令:"
@echo " make install - 安装依赖"
@echo " make run - 启动开发服务器"
@echo " make test - 运行测试"
@echo " make clean - 清理缓存和临时文件"
@echo " make format - 格式化代码"
@echo " make lint - 代码检查"
@echo " make db-migrate - 创建数据库迁移"
@echo " make db-upgrade - 执行数据库迁移"
@echo " make db-downgrade - 回滚数据库迁移"
# 安装依赖
install:
pip install -r requirements.txt
# 启动开发服务器
run:
python run.py
# 运行测试
test:
pytest tests/ -v --cov=app --cov-report=html
# 清理缓存和临时文件
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.pyd" -delete
rm -rf .pytest_cache
rm -rf htmlcov
rm -rf .mypy_cache
rm -rf .coverage
# 格式化代码
format:
black app/ tests/
isort app/ tests/
# 代码检查
lint:
flake8 app/ tests/
mypy app/
# 创建数据库迁移
db-migrate:
@read -p "请输入迁移描述: " desc; \
alembic revision --autogenerate -m "$$desc"
# 执行数据库迁移
db-upgrade:
alembic upgrade head
# 回滚数据库迁移
db-downgrade:
alembic downgrade -1