Commit d37f191b by BellCodeEditor

save project

parent 37d31183
Showing with 19 additions and 3 deletions
...@@ -22,9 +22,25 @@ def register(): # 注册验证 ...@@ -22,9 +22,25 @@ def register(): # 注册验证
name,password1,password2 = app_reg.get_input() name,password1,password2 = app_reg.get_input()
if name == "" or password1 == "" or password2 == "": if name == "" or password1 == "" or password2 == "":
messagebox.showwarning("warning!","please fill these compelitly") messagebox.showwarning("warning!","please fill these compelitly")
elif name in user:
messagebox.showwarning("tips","this has already had")
elif password1 != password2:
messagebox.showwarning("warnning",'two passwords are not the same')
else:
user[name] = password1
content = json.dumps(user)
with open("user.txt","w",encoding="utf-8") as file:
file.write(content)
messagebox.showinfo("success","register is okey")
reg_to_login()
def login(): # 登录验证 def login(): # 登录验证
pass name , password = app_login.get_input()
pwd = user[name]
if pwd == password:
messagebox.showinfo("success","login is okey")
else:
messagebox.showwarning("wrong","there is something wrong")
class My_login(): # 登录窗口 class My_login(): # 登录窗口
def __init__(self): def __init__(self):
......
{"admin": "123456"} {"admin": 12345, "111": "12", "112": "12", "222": "11"}
\ 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