Commit 6e9101ba by BellCodeEditor

save project

parent 80e0e6d0
Showing with 5 additions and 4 deletions
......@@ -26,7 +26,7 @@ def register(): # 注册验证
messagebox.showwarning("错误","两次密码不一致!")
else:
users[name] = password1
content = json.dumps(users,ascii(True))
content = json.dumps(users,ensure_ascii=False)
with open("user.txt","w",encoding="utf-8") as file:
file.write(content)
#成功跳往登陆界面
......@@ -35,8 +35,9 @@ def register(): # 注册验证
def login(): # 登录验证
name,password1 = app_login.get_input()
value= users.get(name)
if value == name:
if value == password1:
messagebox.showinfo("成功","登录成功!")
else:
messagebox.showwarning("错误","用户名或密码错误!")
......
{"admin": "123456"}
\ No newline at end of file
{"admin": "123456", "安抚": "123"}
\ 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