Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson18-diy3
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f98b3ecc
authored
Nov 17, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
1090272e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
my_app.py
user.txt
my_app.py
View file @
f98b3ecc
...
@@ -27,14 +27,21 @@ def register(): # 注册验证
...
@@ -27,14 +27,21 @@ def register(): # 注册验证
elif
mima1
!=
mima2
:
elif
mima1
!=
mima2
:
messagebox
.
showerror
(
"错误"
,
"两次密码不一致"
)
messagebox
.
showerror
(
"错误"
,
"两次密码不一致"
)
else
:
else
:
zd
[
mame
]
=
mima1
def
login
():
# 登录验证
zd
[
name
]
=
mima1
zd
[
name
]
=
mima1
info2
=
json
.
dumps
(
zd
)
info2
=
json
.
dumps
(
zd
)
with
open
(
"user.txt"
,
"w"
,
encoding
=
"utf-8"
)
as
f3
:
with
open
(
"user.txt"
,
"w"
,
encoding
=
"utf-8"
)
as
f3
:
f3
.
write
(
info2
)
f3
.
write
(
info2
)
messagebox
.
showinfo
(
"提示"
,
"用户注册成功"
)
reg_to_login
()
reg_to_login
()
def
login
():
# 登录验证
name
,
mima
=
app_login
.
get_input
()
psw
=
zd
.
get
(
name
)
if
psw
==
mima
:
messagebox
.
showinfo
(
"提示"
,
"用户登录芝士奶棒成功"
)
else
:
messagebox
.
showerror
(
"错误"
,
"用户名或密码芝士奶棒错误"
)
class
My_login
():
# 登录窗口
class
My_login
():
# 登录窗口
def
__init__
(
self
):
def
__init__
(
self
):
self
.
root
=
tkinter
.
Tk
()
self
.
root
=
tkinter
.
Tk
()
...
...
user.txt
View file @
f98b3ecc
{"admin": "123456"}
{"admin": "123456", "a": "1"}
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment