forked from mrlan/EnglishPal
Merge branch 'master' of http://121.4.94.30:3000/mrlan/EnglishPal into SPM2022F-CONTRIBUTORS-jiaojiao
commit
169cf66823
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -62,3 +62,7 @@ function onReadClick() {
|
|||
function onChooseClick() {
|
||||
isChoose = !isChoose;
|
||||
}
|
||||
|
||||
function stopRead() {
|
||||
reader.cancel();
|
||||
}
|
|
@ -5,115 +5,7 @@ You're logged in already!
|
|||
|
||||
{% else %}
|
||||
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0, user-scalable=yes" />
|
||||
<style>
|
||||
|
||||
.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);
|
||||
|
||||
}
|
||||
|
||||
.signin-heading{
|
||||
padding-top: 5px;
|
||||
color: #8C55AA;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 23px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.username, .email, .password, .re-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: 300;
|
||||
}
|
||||
|
||||
li :hover{
|
||||
color: #8C55AA;
|
||||
transition: .5s;
|
||||
}
|
||||
|
||||
h1{
|
||||
font-family: 'ink free';
|
||||
|
||||
}
|
||||
|
||||
.main_menu h1{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" href="static/css/login_service.css">
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
|
|
@ -1,14 +1,22 @@
|
|||
<html>
|
||||
<body>
|
||||
<form action="/reset" method='POST'>
|
||||
旧密码:
|
||||
<input type="password" name="old-password" />
|
||||
<br/>
|
||||
新密码:
|
||||
<input type="password" name="new-password" />
|
||||
<br/>
|
||||
<input type="submit" name="submit" value="提交" />
|
||||
<input type="button" name="submit" value="放弃修改" onclick="window.location.href='/{{ username }}'"/>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
{% block body %}
|
||||
<meta charset="utf-8" name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0, user-scalable=yes"/>
|
||||
<link rel="stylesheet" href="static/css/login_service.css">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<section class="reset-heading">
|
||||
<h1>Reset Password</h1>
|
||||
</section>
|
||||
|
||||
<form action="/reset" method="POST">
|
||||
<input type="password" placeholder="原密码" class="old-password" name="old-password" required>
|
||||
<input type="password" placeholder="新密码" class="new-password" name="new-password" required>
|
||||
<input type="password" placeholder="确认新密码" class="re-new-password" name="re-new-password" required>
|
||||
<input type="submit" name="submit" class="btn" value="提交"/>
|
||||
<input type="button" name="submit" class="btn" value="放弃修改"
|
||||
onclick="window.location.href='/{{ username }}'"/>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -5,117 +5,9 @@ You're logged in already! <a href="/logout">Logout</a>.
|
|||
|
||||
{% else %}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0, user-scalable=yes" />
|
||||
<link rel="stylesheet" href="static/css/login_service.css">
|
||||
<p>{{ get_flashed_messages()[0] | safe }}</p>
|
||||
|
||||
<style>
|
||||
|
||||
.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);
|
||||
|
||||
}
|
||||
|
||||
.signin-heading{
|
||||
padding-top: 5px;
|
||||
color: #8C55AA;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 23px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.username,.password, .re-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: 300;
|
||||
}
|
||||
|
||||
li :hover{
|
||||
color: #8C55AA;
|
||||
transition: .5s;
|
||||
}
|
||||
|
||||
h1{
|
||||
font-family: 'ink free';
|
||||
|
||||
}
|
||||
|
||||
.main_menu h1{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
|
|
@ -23,15 +23,15 @@
|
|||
<body>
|
||||
<div class="container-fluid">
|
||||
<p><b>English Pal for <font id="username" color="red">{{ username }}</font></b>
|
||||
<a class="btn btn-secondary" href="/logout" role="button">退出</a>
|
||||
<a class="btn btn-secondary" href="/reset" role="button">重设密码</a>
|
||||
<a class="btn btn-secondary" href="/logout" role="button" onclick="stopRead()">退出</a>
|
||||
<a class="btn btn-secondary" href="/reset" role="button" onclick="stopRead()">重设密码</a>
|
||||
</p>
|
||||
{{ flashed_messages|safe }}
|
||||
|
||||
<a class="btn btn-success" href="/{{ username }}/reset" role="button"> 下一篇 Next Article </a>
|
||||
<a class="btn btn-success" href="/{{ username }}/reset" role="button" onclick="stopRead()"> 下一篇 Next Article </a>
|
||||
{% if session.get('articleID') != session.get('old_articleID') %}
|
||||
{% if session.get('old_articleID') != None %}
|
||||
<a class="btn btn-success" href="/{{ username }}/back" role="button"> 上一篇 Previous Article </a>
|
||||
<a class="btn btn-success" href="/{{ username }}/back" role="button" onclick="stopRead()"> 上一篇 Previous Article </a>
|
||||
{% endif%}
|
||||
{% endif %}
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
<p><b>收集生词吧</b> (可以在正文中划词,也可以复制黏贴)</p>
|
||||
<form method="post" action="/{{ username }}">
|
||||
<textarea name="content" id="selected-words" rows="10" cols="120"></textarea><br/>
|
||||
<input type="submit" value="把生词加入我的生词库"/>
|
||||
<input type="submit" onclick="stopRead()" value="把生词加入我的生词库"/>
|
||||
<input type="reset" value="清除"/>
|
||||
</form>
|
||||
{% if session.get['thisWord'] %}
|
||||
|
|
Loading…
Reference in New Issue