14 lines
362 B
Python
14 lines
362 B
Python
import sqlite3
|
|
import bcrypt
|
|
|
|
conn = sqlite3.connect('backend/sale.db')
|
|
cursor = conn.cursor()
|
|
|
|
new_password = "admin123"
|
|
hashed = bcrypt.hashpw(new_password.encode('utf-8'), bcrypt.gensalt()).decode('utf-8')
|
|
|
|
cursor.execute("UPDATE users SET password_hash = ? WHERE email = ?", (hashed, "admin@viaeon.com"))
|
|
conn.commit()
|
|
|
|
print("密码已重置为: admin123")
|