Commit 73f796ce by BellCodeEditor

save project

parent 0b541577
Showing with 9 additions and 6 deletions
......@@ -6,7 +6,6 @@ with open("text.txt","r",encoding="utf-8") as tt:
info=tt.read()
user=json.loads(info)
def login_to_reg(): # 登录界面转注册界面
app_login.root.destroy()
global app_reg
......@@ -36,9 +35,13 @@ def register(): # 注册验证
reg_to_login()
def login():
name,passward1 = app_login.get_input()
pwd = user[]
value = adict.
name,passward1 = app_reg.get_input()
pwd = user.get(name)
if pwd == passward1:
messagebox.showwarning('提示','登录成功!')
app_reg.root.destroy()
else:
messagebox.showwarning('错误','用户名或密码错误')
class My_login(): # 登录界面
def __init__(self):
......@@ -60,7 +63,7 @@ class My_login(): # 登录界面
self.screen_number.place(x=140,y=140) # 密码窗口的坐标
button = tkinter.Button(self.root,text='注册',font=(('宋体'),15),bg='lightgreen',command=login_to_reg) # 注册按钮
button.place(x=280,y=200) # 按钮位置
widge = tkinter.Button(self.root,text='登录',font=(('宋体'),15),bg='lightblue',command=register) # 登录按钮
widge = tkinter.Button(self.root,text='登录',font=(('宋体'),15),bg='lightblue',command=login) # 登录按钮
widge.place(x=140,y=200) # 按钮位置
self.root.mainloop() # 保持运行
......@@ -89,7 +92,7 @@ class My_register():
self.screen_number.place(x=140,y=140) # 密码窗口的坐标
self.screen_numbers = tkinter.Entry(self.root,show='*',font=('宋体',14),bg='light grey',width=18) # 设置确认密码窗口
self.screen_numbers.place(x=140,y=200) # 确认密码的坐标
button = tkinter.Button(self.root,text='提交',font=(('宋体'),15),bg='lightblue',command=register) # 提交按钮
button = tkinter.Button(self.root,text='提交',font=(('宋体'),15),bg='lightblue',command=login_to_reg) # 提交按钮
button.place(x=280,y=240) # 按钮位置
widge = tkinter.Button(self.root,text='取消',font=(('宋体'),15),bg='lightgreen',command=reg_to_login) # 取消按钮
widge.place(x=140,y=240) # 按钮位置
......
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