26 lines
699 B
Python
26 lines
699 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
检查管理员账号
|
|
"""
|
|
|
|
from app import create_app
|
|
from app.models.admin import Admin
|
|
|
|
def check_admin():
|
|
"""检查管理员账号"""
|
|
app = create_app()
|
|
|
|
with app.app_context():
|
|
admin = Admin.query.filter_by(username='admin').first()
|
|
print(f"Admin exists: {admin is not None}")
|
|
if admin:
|
|
print(f"Admin username: {admin.username}")
|
|
print(f"Admin password hash: {admin.password_hash}")
|
|
print(f"Admin role: {admin.role}")
|
|
print(f"Admin status: {admin.status}")
|
|
else:
|
|
print("No admin user found")
|
|
|
|
if __name__ == "__main__":
|
|
check_admin() |