Commit 1f40a1d7 by BellCodeEditor

save project

parent e33d3680
Showing with 13 additions and 2 deletions
import tkinter
from tkinter import messagebox
import json
with open('user.txt','r',encoding='utf-8') as f:
info=f.read()
users=json.loads(info)
def login_to_reg(): # 登录界面转注册界面
app_login.root.destroy()
......@@ -19,6 +24,12 @@ def register(): # 注册验证
messagebox.showerror('错误','请填写正确的用户资料')
elif password1 != password2:
messagebox.showerror('错误','两次密码不相同')
elif name in users:
messagebox.showerror('错误','用户名已被填写')
else:
users[name]=password1
content=json.dumps(users)
def login(): # 登录验证
pass
......
{"admin": "123456"}
\ No newline at end of file
{"a": "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