deploy: Update frontend build for deployment
This commit is contained in:
1 parent
f18b6ce2df
commit
b3e233bf76
6 files changed
+306
-2266
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
密码重置脚本
|
||||
用途:用于重置用户密码,特别是在用户忘记密码时
|
||||
使用方法:python3 reset_password.py <username> <new_password>
|
||||
"""
|
||||
import sys
|
||||
from app import create_app, db
|
||||
from app.models import User
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
print("Usage: python3 reset_password.py <username> <new_password>")
|
||||
print("Example: python3 reset_password.py admin Hxit@54321")
|
||||
sys.exit(1)
|
||||
|
||||
username = sys.argv[1]
|
||||
new_password = sys.argv[2]
|
||||
|
||||
app = create_app()
|
||||
with app.app_context():
|
||||
# 查找用户
|
||||
user = User.query.filter_by(username=username).first()
|
||||
if user:
|
||||
print(f"Found user: {user.username}, Role: {user.role}")
|
||||
# 设置新密码
|
||||
user.set_password(new_password)
|
||||
db.session.commit()
|
||||
print(f"✅ SUCCESS: Password reset for user '{username}' to '{new_password}'")
|
||||
else:
|
||||
print(f"❌ FAILURE: User '{username}' not found")
|
||||
# 列出所有可用用户
|
||||
print("\nAvailable users:")
|
||||
users = User.query.all()
|
||||
for u in users:
|
||||
print(f" - {u.username} (Role: {u.role})")
|
||||
Reference in new issue
Block a user