Commit efc6f3b7 by BellCodeEditor

save project

parent 37f291b4
Showing with 9 additions and 4 deletions
......@@ -20,11 +20,11 @@ def reg_to_login(): # 注册界面转登录界面
def register(): # 注册验证
name,password1,password2 = app_reg.get_input()
if name=="" or password1=="" or password2=="":
showerror("错误","请填写完整的注册信息")
messagebox.showerror("错误","请填写完整的注册信息")
elif name in user:
showwarning("警告","该用户名已存在")
messagebox.showwarning("警告","该用户名已存在")
elif password1 != password2:
showwarning("警告","两次密码不一致")
messagebox.showwarning("警告","两次密码不一致")
else:
user[name] = password1
content = json.dumps(users)
......@@ -35,7 +35,12 @@ def register(): # 注册验证
reg_to_login()
def login(): # 登录验证
pass
name,password = app_login.get_input()
pwd = users.get(name)
if pwd == password:
messagebox.showinfo("成功","登录成功")
else:
messagebox.showerror("错误","用户名或密码错误")
class My_login(): # 登录窗口
def __init__(self):
......
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