21 lines
588 B
Python
21 lines
588 B
Python
import os
|
|
import sys
|
|
|
|
# 添加项目根目录到Python路径
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
# 设置数据库URL为SQLite
|
|
os.environ['DATABASE_URL'] = 'sqlite:///kamaxitong.db'
|
|
|
|
from app import create_app, db
|
|
from app.models.admin import Admin
|
|
|
|
# 创建应用实例
|
|
app = create_app()
|
|
|
|
with app.app_context():
|
|
# 检查管理员数据
|
|
admins = Admin.query.all()
|
|
print(f"Found {len(admins)} admin users:")
|
|
for admin in admins:
|
|
print(f" - ID: {admin.admin_id}, Username: {admin.username}, Role: {admin.role}, Status: {admin.status}") |