1
0
mirror of https://github.com/newnius/YAO-portal.git synced 2025-06-07 15:41:56 +00:00
YAO-portal/static/script.js
2019-05-06 14:56:40 +08:00

32 lines
661 B
JavaScript

$(function () {
$("#btn-signout").click(function (e) {
e.preventDefault();
var ajax = $.ajax({
url: "service?action=user_signout",
type: 'POST',
data: {}
});
ajax.done(function (res) {
window.location.pathname = "/";
});
});
$("#btn-oauth-login").click(function (e) {
e.preventDefault();
var ajax = $.ajax({
url: "service?action=user_login",
type: 'POST',
data: {}
});
ajax.done(function (res) {
if (res["errno"] !== 0) {
$("#modal-msg-content").html(res["msg"]);
$("#modal-msg").modal('show');
} else {
window.location.pathname = "/ucenter";
}
});
});
$('.date-picker').datetimepicker();
});