1
0
mirror of https://github.com/newnius/YAO-portal.git synced 2025-06-07 23:51:55 +00:00
YAO-portal/static/script.js

32 lines
661 B
JavaScript
Raw Normal View History

2019-01-15 02:02:28 +00:00
$(function () {
$("#btn-signout").click(function (e) {
e.preventDefault();
var ajax = $.ajax({
2019-05-06 06:56:40 +00:00
url: "service?action=user_signout",
2019-01-15 02:02:28 +00:00
type: 'POST',
data: {}
});
ajax.done(function (res) {
window.location.pathname = "/";
});
});
$("#btn-oauth-login").click(function (e) {
e.preventDefault();
var ajax = $.ajax({
2019-05-06 06:56:40 +00:00
url: "service?action=user_login",
2019-01-15 02:02:28 +00:00
type: 'POST',
data: {}
});
ajax.done(function (res) {
2019-04-23 08:57:15 +00:00
if (res["errno"] !== 0) {
$("#modal-msg-content").html(res["msg"]);
$("#modal-msg").modal('show');
} else {
window.location.pathname = "/ucenter";
}
2019-01-15 02:02:28 +00:00
});
});
$('.date-picker').datetimepicker();
});