添加期末大作业文件夹Project,目前与Assignment5中一致
This commit is contained in:
96
Project/templates/modify.html
Normal file
96
Project/templates/modify.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<title>修改账户</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<script src="https://cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
var message = "";
|
||||
{% for msg in messages %}
|
||||
message += "{{ msg }}\n";
|
||||
{% endfor %}
|
||||
alert(message);
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="#" method="post">
|
||||
<ul>
|
||||
<div>
|
||||
<div>证件号码:</div>
|
||||
<input type="text" id="cardCode" name="cardCode" placeholder="请输入您的证件号码" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>登陆密码:</div>
|
||||
<input type="password" id="password" placeholder="请输入您的密码" required>
|
||||
<input id="encryptedPassword" name="encryptedPassword" type="hidden">
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>修改内容:</div>
|
||||
<select id="modifyType" name="modifyType" onchange="modify.showModifyPassword()" aria-label="请选择您的修改内容" title="请选择您的修改内容" required>
|
||||
<option value="1">删除账户</option>
|
||||
<option value="2">修改密码</option>
|
||||
<option value="3">修改手机号</option>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
<li class="modifyPassword" style="display: none;">
|
||||
<div>
|
||||
<div>修改密码:</div>
|
||||
<input type="password" id="newPassword" placeholder="6-20位字母、数字或符号">
|
||||
<input id="encryptedNewPassword" name="encryptedNewPassword" type="hidden">
|
||||
</div>
|
||||
</li>
|
||||
<li class="modifyPassword" style="display: none;">
|
||||
<div>
|
||||
<div>确认密码:</div>
|
||||
<input type="password" id="confirmPassword" placeholder="再次输入您的修改密码">
|
||||
</div>
|
||||
</li>
|
||||
<li class="modifymobileNo" style="display: none;">
|
||||
<div>
|
||||
<div>修改手机号:</div>
|
||||
<input type="text" id="mobileNo" name="mobileNo" value title="手机号码" aria-label="手机号码" maxlength="11" placeholder="11位手机号">
|
||||
</div>
|
||||
</li>
|
||||
<div>
|
||||
<button type="submit" onclick="return submitForm()">确认</button>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
</form>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/checkInfo.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/modify.js') }}"></script>
|
||||
<script>
|
||||
function submitForm() {
|
||||
document.getElementById('encryptedPassword').value = md5(
|
||||
document.getElementById('password').value
|
||||
)
|
||||
|
||||
let modifyType = document.getElementById('modifyType').value
|
||||
if (modifyType === '1') {
|
||||
// document.getElementById('newPassword') = ''
|
||||
return true
|
||||
} else if (modifyType == '2') {
|
||||
document.getElementById('encryptedNewPassword').value = md5(
|
||||
document.getElementById('newPassword').value
|
||||
)
|
||||
return checkInfo.checkNewPassword()
|
||||
} else if (modifyType == '3') {
|
||||
return checkInfo.checkMobileNo()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user