From 5c85041135020001c2163f129e6940da2bb31639 Mon Sep 17 00:00:00 2001
From: renyu <1154817144@qq.com>
Date: Fri, 25 Nov 2022 15:42:37 +0800
Subject: [PATCH 1/2] =?UTF-8?q?Bug=20512=20-=20=E6=96=87=E7=AB=A0=E6=9C=97?=
=?UTF-8?q?=E8=AF=BB=E9=97=AE=E9=A2=98=20=E5=9C=A8fillwowrd.js=E4=B8=AD?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86stopRead()=E5=87=BD=E6=95=B0?=
=?UTF-8?q?=EF=BC=8C=E5=B0=86=E5=85=B6=E6=B7=BB=E5=8A=A0=E7=BB=99=E5=AF=B9?=
=?UTF-8?q?=E5=BA=94=E6=8C=89=E9=92=AE=E6=88=96=E8=B6=85=E9=93=BE=E6=8E=A5?=
=?UTF-8?q?=E4=BB=A5=E7=BB=88=E6=AD=A2=E6=9C=97=E8=AF=BB=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/static/js/fillword.js | 4 ++++
app/templates/userpage_get.html | 10 +++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
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/userpage_get.html b/app/templates/userpage_get.html
index 9e3891b..24bff60 100644
--- a/app/templates/userpage_get.html
+++ b/app/templates/userpage_get.html
@@ -23,15 +23,15 @@
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'] %}
From e74f1ff477f4d4a72fecd488837b2785ea2c1be7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E8=89=BA=E8=85=BE?= <2483750517@qq.com>
Date: Sat, 3 Dec 2022 20:52:01 +0800
Subject: [PATCH 2/2] Bug505-ZhangYiteng (#61)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bug修改只涉及到account_service.py中新增的5行。
其他增删都是重写reset.html(页面样式和login、signup页面相一致),并将reset、signup、login三个页面的共同样式抽离出独立的css文件。
Co-authored-by: Q_yt <2483750517@qq.com>
Co-authored-by: Hui Lan
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/61
Co-authored-by: 张艺腾 <2483750517@qq.com>
Co-committed-by: 张艺腾 <2483750517@qq.com>
---
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 | 110 +------------------------------
5 files changed, 138 insertions(+), 232 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 %}
-
+