初步完成登录、注册、修改账号、主页内容
This commit is contained in:
32
Project/static/js/signup.js
Normal file
32
Project/static/js/signup.js
Normal file
@@ -0,0 +1,32 @@
|
||||
function submitForm() {
|
||||
let isValid = true;
|
||||
clearErrors();
|
||||
|
||||
if (!checkInfo.checkMobileNo()) {
|
||||
document.getElementById('mobileNoError').innerText = '手机号格式有误';
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (!checkInfo.checkPassword()) {
|
||||
document.getElementById('passwordError').innerText = '密码须为长度为6-20位字母、数字或符号';
|
||||
document.getElementById('confirmPasswordError').innerText = '两次输入的密码不一致';
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (isValid) {
|
||||
document.getElementById('encryptedPassword').value = md5(
|
||||
document.getElementById('password').value
|
||||
);
|
||||
document.getElementById('encryptedConfirmPassword').value = md5(
|
||||
document.getElementById('confirmPassword').value
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function clearErrors() {
|
||||
document.getElementById('mobileNoError').innerText = '';
|
||||
document.getElementById('passwordError').innerText = '';
|
||||
document.getElementById('confirmPasswordError').innerText = '';
|
||||
}
|
||||
Reference in New Issue
Block a user