更新 login.html

master
wangsiyuan 2024-01-18 21:20:36 +08:00
parent f1abd66657
commit ba0ad95e8d
1 changed files with 15 additions and 4 deletions

View File

@ -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>