Commit 9bfaaffd by BellCodeEditor

save project

parent 1653bacb
Showing with 6 additions and 1 deletions
...@@ -85,6 +85,9 @@ def register(): # 注册验证 ...@@ -85,6 +85,9 @@ def register(): # 注册验证
elif password1 != password2: elif password1 != password2:
messagebox.showwarning("错误", "两次密码不一致!") messagebox.showwarning("错误", "两次密码不一致!")
else: else:
user_info={}
user_info["password"]password1
user_info["event"]=["提示1:可以从输入框添加新任务","提示2:点击选择框表示完成"]
users[name] = password1 users[name] = password1
content = json.dumps(users) content = json.dumps(users)
with open("user.txt", "w", encoding="utf-8") as file: # "w"每次写入都覆盖原来的内容 with open("user.txt", "w", encoding="utf-8") as file: # "w"每次写入都覆盖原来的内容
...@@ -97,8 +100,10 @@ def login(): ...@@ -97,8 +100,10 @@ def login():
global app # 登录验证 global app # 登录验证
name, password = app_login.get_input() name, password = app_login.get_input()
pwd = users.get(name) pwd = users.get(name)
if pwd == password: user_name=users.get(name)
if user_name!=None and user_name["password"]==password:
#messagebox.showinfo("成功", "登录成功") #messagebox.showinfo("成功", "登录成功")
alist=users[name]["event"]
app_login.root.destroy() app_login.root.destroy()
app = Note() app = Note()
app.show() app.show()
......
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