Commit 2609f380 by BellCodeEditor

save project

parent cf5e256c
Showing with 14 additions and 3 deletions
......@@ -36,10 +36,15 @@ def register(): # 注册验证
reg_to_login()
def login(): # 登录验证
global app,alist
name, password = app_login.get_input()
pwd = users.get(name)
if pwd == password:
messagebox.showinfo("成功", "登录成功")
user_name = users.get(name)
if user_name != None and user_name["password"] == password:
alist = users[name]["event"]
app_login.root.destroy()
app = Note()
app.show()
app.root.mainloop()
else:
messagebox.showwarning("错误", "用户名或密码错误!")
......
......@@ -36,12 +36,18 @@ class Note(): # 便签、笔记
info = self.ent.get()
self.ent.delete("0", END)
if info != "":
alist.append(info)
content = json.dumps(users)
with open("user.txt","w",encoding="utf8") as file:
file.write(content)
alist.append(info)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),
anchor=W, fill='#FF9900')
self.y += 30
app = Note()
app.show()
app.root.mainloop()
......
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