Commit 70975396 by BellCodeEditor

save project

parent 4313342d
Showing with 4 additions and 3 deletions
...@@ -24,9 +24,10 @@ def register(): ...@@ -24,9 +24,10 @@ def register():
messagebox.showwarning("错误","用户名已存在!") messagebox.showwarning("错误","用户名已存在!")
elif password1 != password2: elif password1 != password2:
messagebox.showwarning("错误","两次密码不一致!") messagebox.showwarning("错误","两次密码不一致!")
else:users[name]=json.dumps(users) else:
content=json.dumps(users) users[name]=json.dumps(users)
with open("user.txt","w",encoding="utf-8") as file: content = json.dumps(users)
with open("user.txt","w",encoding="utf-8") as file:
file.write(content) file.write(content)
messagebox.showinfo("成功","注册成功") messagebox.showinfo("成功","注册成功")
reg_to_login() reg_to_login()
......
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