yuuki/libs/webadmin/static/js/verify.js

28 lines
821 B
JavaScript
Raw Normal View History

2020-02-08 15:44:20 +08:00
/** global: Cookies */
2020-02-08 00:55:19 +08:00
/*
Yuuki_Libs
(c) 2020 Star Inc.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
2020-01-25 20:32:24 +08:00
$(function () {
$('form.login-box').on('submit', function (e) {
$.ajax({
type: "POST",
url: "/verify",
data: $(this).serialize(),
success: function (data) {
if (data.status == 200) {
Cookies.set('yuuki_admin', data.session);
location.reload();
} else {
2020-02-08 15:05:09 +08:00
$(".status").text("Wrong password");
$(".status").fadeIn();
2020-01-25 20:32:24 +08:00
}
}
});
e.preventDefault();
});
});