Commit 46f6f478 by BellCodeEditor

save project

parent 98301a8d
Showing with 12 additions and 4 deletions
...@@ -27,9 +27,17 @@ def register(): # 注册验证 ...@@ -27,9 +27,17 @@ def register(): # 注册验证
messagebox.showerror("错误","密码不一致!") messagebox.showerror("错误","密码不一致!")
else: else:
users[name] = password1 users[name] = password1
content = json.dumps(users)
with open("user.txt","w",encoding="utf_8") as file:
file.write(content)
#messagebox.showinfo("提示","登录完成")
def login(): # 登录验证 def login(): # 登录验证
pass name,password =app_login.get_input()
pwd = users.get(name)
if pwd == name:
messagebox.showinfo("成功","登录完成")
else:
messagebox.showwarning("错误","用户或密码不存在")
class My_login(): # 登录窗口 class My_login(): # 登录窗口
def __init__(self): def __init__(self):
......
{"admin": "123456"} {"admin": "123456", "1": "1", "11": "11", "123": "1", "1234": "1", "123456": "1"}
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment