This commit is contained in:
dengrb1 2023-04-24 13:21:07 +08:00 committed by GitHub
parent 1eb5e096af
commit 5aaff06352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,10 +11,10 @@ def validate_password():
input_pass = hashlib.sha256(password_entry.get().encode('utf-8')).hexdigest() input_pass = hashlib.sha256(password_entry.get().encode('utf-8')).hexdigest()
if input_user == username and input_pass == password_hash: if input_user == username and input_pass == password_hash:
messagebox.showinfo('Login', 'Login successful') messagebox.showinfo('Login', '密码正确')
password_entry.delete(0, END) password_entry.delete(0, END)
else: else:
messagebox.showerror('Login', 'Invalid username or password') messagebox.showerror('Login', '密码错误')
password_entry.delete(0, END) password_entry.delete(0, END)
# 创建主窗口 # 创建主窗口