easyctf-2017/web/js/login.js

17 lines
404 B
JavaScript
Raw Normal View History

2015-12-25 00:57:58 +00:00
$("#login-form").on("submit", function(e) {
e.preventDefault();
login($("#email").val(), $("#password").val());
});
function login(email, password) {
$.post("/api/user/login", {
email: email,
password: password
}, function(data) {
$("#status").text(data.message);
if (data.success == 1) {
// wait then redirect or whatever
}
});
}