/** * Created by Administrator on 2016/11/29. */ 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('
'); var token = checkCookie(); var startDate = moment().subtract(0, '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.set("token",null); localStorage.removeItem('account') localStorage.removeItem("version"); localStorage.removeItem("menus"); location.href = "../pages/login.html"; } }); }