版本1.0.4 - 发布前准备
- 修复system.py缩进错误 - 优化前端页面样式(待重构) - 改进API接口结构 - 完善文档和自动化脚本 - 平台基本功能稳定运行
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import sys
|
||||
sys.path.insert(0, '.')
|
||||
|
||||
from core.security import get_current_user
|
||||
from app.database import SessionLocal
|
||||
from app.models import User
|
||||
|
||||
print("Testing get_current_user...")
|
||||
db = SessionLocal()
|
||||
try:
|
||||
# 检查数据库中是否有 admin 用户
|
||||
user = db.query(User).filter(User.username == 'admin').first()
|
||||
if user:
|
||||
print(f"Found admin user: id={user.id}, role={user.role}")
|
||||
else:
|
||||
print("Admin user not found")
|
||||
finally:
|
||||
db.close()
|
||||
print("OK")
|
||||
Reference in New Issue
Block a user