commento/frontend/js/self.js

21 lines
435 B
JavaScript
Raw Normal View History

2018-06-04 00:06:17 +08:00
(function (global, document) {
// Get self details.
global.selfGet = function(callback) {
var json = {
"session": global.cookieGet("session"),
};
global.post(global.origin + "/api/owner/self", json, function(resp) {
if (!resp.success || !resp.loggedIn) {
document.location = "/login";
return;
}
global.owner = resp.owner;
callback();
});
};
}(window, document));