Commit f98b3ecc by BellCodeEditor

save project

parent 1090272e
Showing with 11 additions and 4 deletions
...@@ -27,14 +27,21 @@ def register(): # 注册验证 ...@@ -27,14 +27,21 @@ def register(): # 注册验证
elif mima1 != mima2: elif mima1 != mima2:
messagebox.showerror("错误","两次密码不一致") messagebox.showerror("错误","两次密码不一致")
else: else:
zd[mame] = mima1
def login(): # 登录验证
zd[name] = mima1 zd[name] = mima1
info2 = json.dumps(zd) info2 = json.dumps(zd)
with open("user.txt","w",encoding="utf-8") as f3: with open("user.txt","w",encoding="utf-8") as f3:
f3.write(info2) f3.write(info2)
messagebox.showinfo("提示","用户注册成功")
reg_to_login() reg_to_login()
def login(): # 登录验证
name, mima = app_login.get_input()
psw = zd.get(name)
if psw == mima:
messagebox.showinfo("提示","用户登录芝士奶棒成功")
else:
messagebox.showerror("错误","用户名或密码芝士奶棒错误")
class My_login(): # 登录窗口 class My_login(): # 登录窗口
def __init__(self): def __init__(self):
self.root = tkinter.Tk() self.root = tkinter.Tk()
......
{"admin": "123456"} {"admin": "123456", "a": "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