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
5 months ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
1090272e
c403082l1593p256a15370/wx689595
Hide 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(): # 注册验证
elif
mima1
!=
mima2
:
messagebox
.
showerror
(
"错误"
,
"两次密码不一致"
)
else
:
zd
[
mame
]
=
mima1
def
login
():
# 登录验证
zd
[
name
]
=
mima1
info2
=
json
.
dumps
(
zd
)
with
open
(
"user.txt"
,
"w"
,
encoding
=
"utf-8"
)
as
f3
:
f3
.
write
(
info2
)
messagebox
.
showinfo
(
"提示"
,
"用户注册成功"
)
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
():
# 登录窗口
def
__init__
(
self
):
self
.
root
=
tkinter
.
Tk
()
...
...
This diff is collapsed.
Click to expand it.
user.txt
View file @
f98b3ecc
{"admin": "123456"}
\ No newline at end of file
{"admin": "123456", "a": "1"}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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