更新 login.html
parent
f1abd66657
commit
ba0ad95e8d
|
|
@ -137,12 +137,18 @@
|
|||
contentType: 'application/json',
|
||||
data: JSON.stringify({username: email, password: password}),
|
||||
success: function(response) {
|
||||
// 处理响应
|
||||
console.log(response);
|
||||
if (response.code === "0" && response.msg === 'ok') {
|
||||
window.location.href = '/index'; // 确保这是正确的重定向 URL
|
||||
} else {
|
||||
alert("账号或密码错误");
|
||||
setTimeout(function() {
|
||||
window.location.href = '/login';
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// 处理错误
|
||||
console.error(error);
|
||||
window.location.href = '/error';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -152,6 +158,11 @@
|
|||
$('#login span').eq(1).click();
|
||||
}
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$('.left').click(function() {
|
||||
window.location.href = '/reg'; // 将 '/register' 替换为您的注册页面 URL
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Reference in New Issue