Commit ba3af843 by BellCodeEditor

save project

parent d1f7cf43
Showing with 19 additions and 3 deletions
import tkinter
import json
from tkinter import messagebox
# with open('user.txt','w",encoding="utf-8") as f:
# info=f.read()
# users=json.loads(info)
def login_to_reg(): # 登录界面转注册界面
app_login.root.destroy()
......@@ -14,7 +20,19 @@ def reg_to_login(): # 注册界面转登录界面
def register(): # 注册验证
name,password1,password2=app_reg.get_input()
if name=""
if name=="" or password1=="" or password2=="":
messagebox.showwarning('身份信息未填写完整')
elif name in users:
messagebox.showwarning('已有此用户名')
elif password1!=password2:
messagebox.showerror('密码错误')
else:
users[name]=password1
contont=json.dumps(users)
with open('user.txt','w',encoding='utf-8') as file:
file.write(content)
messagebox.showinfo('注册成功')
reg_to_login()
def login(): # 登录验证
pass
......
{"admin": "123456"}
\ 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