You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
function checkCookie() {
|
|
var token = cookie.get("token");
|
|
if (token && token.length > 0) {
|
|
return token;
|
|
} else {
|
|
location.href = "../pages/login.html";
|
|
return null;
|
|
}
|
|
}
|
|
|
|
function initPage(title) {
|
|
$('#page-wrapper').append('<div class="row"><div class="col-lg-12"><h2 class="page-header">'+title+'</h2></div></div>');
|
|
|
|
var token = checkCookie();
|
|
var startDate = moment().subtract(15, 'days').format('YYYY-MM-DD');
|
|
var endDate = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
|
var args = { token: token, startDate: startDate, endDate: endDate };
|
|
return args;
|
|
}
|
|
|
|
function logout() {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: Page.SvrIp + "/api/logout",
|
|
data: {
|
|
token: cookie.get("token"),
|
|
},
|
|
dataType: "json",
|
|
success: function (d) {
|
|
cookie.remove("token");
|
|
localStorage.removeItem("account")
|
|
localStorage.removeItem("version");
|
|
localStorage.removeItem("menus");
|
|
location.href = "../pages/login.html";
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|