From b7500646c2ba3385e3df43ad700d6a9705802b68 Mon Sep 17 00:00:00 2001 From: Q_yt <2483750517@qq.com> Date: Sat, 3 Dec 2022 12:20:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Bug505=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E9=87=8D=E5=86=99reset.html=EF=BC=8C=E6=8A=BD=E7=A6=BB?= =?UTF-8?q?=E5=85=B1=E5=90=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/account_service.py | 7 ++ app/static/css/login_service.css | 107 +++++++++++++++++++++++++++++ app/templates/login.html | 110 +----------------------------- app/templates/reset.html | 36 ++++++---- app/templates/signup.html | 112 +------------------------------ 5 files changed, 139 insertions(+), 233 deletions(-) create mode 100644 app/static/css/login_service.css diff --git a/app/account_service.py b/app/account_service.py index 09439d5..dc854a3 100644 --- a/app/account_service.py +++ b/app/account_service.py @@ -112,6 +112,13 @@ def reset(): # POST请求用于提交修改后信息 old_password = escape(request.form['old-password']) new_password = escape(request.form['new-password']) + + re_new_password = escape(request.form['re-new-password']) # 确认新密码 + if re_new_password != new_password: #验证新密码两次输入是否相同 + return '新密码不匹配,请重新输入' + if len(new_password) < 4: #验证新密码长度,原则参照注册模块 + return '密码过于简单。(密码长度至少4位)' + flag = change_password(username, old_password, new_password) # flag表示是否修改成功 if flag: session['logged_in'] = False diff --git a/app/static/css/login_service.css b/app/static/css/login_service.css new file mode 100644 index 0000000..50277e6 --- /dev/null +++ b/app/static/css/login_service.css @@ -0,0 +1,107 @@ +/*样式应用于login、signup、reset三个页面*/ + +.container { + background-color: #FFFFFF; + width: 400px; + height: 500px; + margin: 7em auto; + border-radius: 1.5em; + box-shadow: 0px 11px 35px 2px rgba(0, 0, 0, 0.14); +} + +/*增加一个类reset-heading*/ +.signin-heading, .reset-heading { + padding-top: 5px; + color: #8C55AA; + font-family: 'Ubuntu', sans-serif; + font-weight: bold; + font-size: 23px; + text-align: center; +} + +/*增加2个类.old-password和.new-password*/ +.username, .email, .password, .re-password, .old-password, .new-password,.re-new-password { + width: 76%; + color: rgb(38, 50, 56); + font-weight: 700; + font-size: 14px; + letter-spacing: 1px; + background: rgba(136, 126, 126, 0.04); + padding: 10px 20px; + border: none; + border-radius: 20px; + outline: none; + box-sizing: border-box; + border: 2px solid rgba(124, 16, 97, 0.02); + margin-bottom: 50px; + margin-left: 46px; + text-align: center; + margin-bottom: 27px; + font-family: 'Ubuntu', sans-serif; +} + +.btn { + width: 50%; + border: none; + border-radius: 20px; + box-sizing: border-box; + border: 2px solid #8C55AA; + margin-bottom: 50px; + margin-left: 90px; + padding: 10px 20px; + +} + +.btn:hover { + + background: #8C55AA; + transition: .5s; + cursor: pointer; + color: #fff; +} + + +.signup { + display: flex; + justify-content: center; + align-items: center; +} + +ul { + position: absolute; + display: flex; + left: 65%; + +} + +li { + padding: 10px; + margin: 10px; +} + +a { + text-decoration: none; + list-style: none; + font-weight: bold; + font-family: 'ink free'; + +} + +.main_menu a { + color: #fff; + font-size: 300px; +} + +li :hover { + color: #8C55AA; + transition: .5s; +} + +h1 { + font-family: 'ink free'; + +} + +.main_menu h1 { + color: #fff; +} \ No newline at end of file diff --git a/app/templates/login.html b/app/templates/login.html index e3e19d1..a347e22 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -5,115 +5,7 @@ You're logged in already! {% else %} - +
{{ get_flashed_messages()[0] | safe }}
+ +{{ get_flashed_messages()[0] | safe }}
-