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/static/js/fillword.js b/app/static/js/fillword.js index 505808e..ba249dd 100644 --- a/app/static/js/fillword.js +++ b/app/static/js/fillword.js @@ -62,3 +62,7 @@ function onReadClick() { function onChooseClick() { isChoose = !isChoose; } + +function stopRead() { + reader.cancel(); +} \ 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 }}
-English Pal for {{ username }} - 退出 - 重设密码 + 退出 + 重设密码
{{ flashed_messages|safe }} - 下一篇 Next Article + 下一篇 Next Article {% if session.get('articleID') != session.get('old_articleID') %} {% if session.get('old_articleID') != None %} - 上一篇 Previous Article + 上一篇 Previous Article {% endif%} {% endif %} @@ -52,7 +52,7 @@收集生词吧 (可以在正文中划词,也可以复制黏贴)
{% if session.get['thisWord'] %}